Bug 524469: Opening enough tabs to create additional columns cuts off the initial column [r=mark.finkle]
authorVivien Nicolas <21@vingtetun.org>
Tue, 01 Dec 2009 23:20:58 -0500
changeset 65877 1e77f6120bc760dd812c6644132985dcbe7350d5
parent 65876 19fd3580f58c5d3cb1596f7a611e3b830e5fc0fc
child 65878 f9886d1651aeea4ec39dea93414bfd931e8c370e
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs524469
Bug 524469: Opening enough tabs to create additional columns cuts off the initial column [r=mark.finkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -648,20 +648,28 @@ var BrowserUI = {
         break;
       case "DOMWindowClose":
         this._domWindowClose(aEvent);
         break;
       case "TabSelect":
         this._tabSelect(aEvent);
         break;
       case "TabOpen":
-        if (!this.isTabsVisible() && 
-            Browser.selectedTab.chromeTab != aEvent.target)
+      {
+        if (!this.isTabsVisible() && Browser.selectedTab.chromeTab != aEvent.target)
           NewTabPopup.show(aEvent.target);
+
+          // Workaround to hide the tabstrip if it is partially visible
+          // See bug 524469
+          let [tabstripV,,,] = Browser.computeSidebarVisibility();
+          if (tabstripV > 0 && tabstripV < 1)
+            Browser.hideSidebars();
+
         break;
+      }
       // URL textbox events
       case "click":
         this.doCommand("cmd_openLocation");
         break;
       case "keypress":
         if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
           let dialog = this.activeDialog;
           if (dialog)
@@ -832,30 +840,30 @@ var NewTabPopup = {
     }
 
     this._tabs = [];
     this.box.hidden = true;
     BrowserUI.popPopup();
   },
   
   show: function(aTab) {
+    BrowserUI.pushPopup(this, this.box);
+
     this._tabs.push(aTab);
     this._updateLabel();
 
     this.box.top = aTab.getBoundingClientRect().top + (aTab.getBoundingClientRect().height / 3);
     this.box.hidden = false;
 
     if (this._timeout)
       clearTimeout(this._timeout);
 
     this._timeout = setTimeout(function(self) {
       self.hide();
     }, 2000, this);
-
-    BrowserUI.pushPopup(this, this.box);
   },
 
   selectTab: function() {
     BrowserUI.selectTab(this._tabs.pop());
     this.hide();
   }
 }
 
@@ -877,18 +885,16 @@ var BookmarkPopup = {
   },
   
   show : function show(aAutoClose) {
     const margin = 10;
 
     this.box.hidden = false;
 
     let [,,,controlsW] = Browser.computeSidebarVisibility();
-    Components.reportError("bar: " + controlsW);
-    Components.reportError("box: " + this.box.getBoundingClientRect().width)
     this.box.left = window.innerWidth - (this.box.getBoundingClientRect().width + controlsW + margin);
     this.box.top  = BrowserUI.starButton.getBoundingClientRect().top + margin;
 
     if (aAutoClose) {
       this._bookmarkPopupTimeout = setTimeout(function (self) {
         self._bookmarkPopupTimeout = -1;
         self.hide();
       }, 2000, this);