Bug 585393 - left tab title text shifts when a new tab is added. r=dao a=dolske
authorFrank Yan <fyan@mozilla.com>
Fri, 07 Jan 2011 16:35:33 -0800
changeset 60227 11362bbb1bfa028bf3a83db7b9555fb949163183
parent 60226 aa2cb417ef96503b312652e7e8d262ebe8219c39
child 60228 556d2c5bef08e48abcd1010bb5ef1494e8de3b23
push id17889
push userfyan@mozilla.com
push dateSat, 08 Jan 2011 00:46:07 +0000
treeherdermozilla-central@556d2c5bef08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, dolske
bugs585393
milestone2.0b9pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 585393 - left tab title text shifts when a new tab is added. r=dao a=dolske
browser/base/content/tabbrowser.css
browser/base/content/tabbrowser.xml
browser/themes/pinstripe/browser/browser.css
--- a/browser/base/content/tabbrowser.css
+++ b/browser/base/content/tabbrowser.css
@@ -6,17 +6,17 @@
   -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-arrowscrollbox");
 }
 
 .tab-close-button {
   -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-close-tab-button");
   display: none;
 }
 
-.tabbrowser-tabs:not([closebuttons="noclose"]):not([closebuttons="closeatend"]) > * > * > * .tab-close-button:not([pinned])[selected="true"],
+.tabbrowser-tabs[closebuttons="activetab"] > * > * > * > .tab-close-button:not([pinned])[selected="true"],
 .tabbrowser-tabs[closebuttons="alltabs"] > * > * > * > .tab-close-button:not([pinned]) {
   display: -moz-box;
 }
 
 .tab-close-button[selected="true"] {
   /* Make this button focusable so clicking on it will not focus the tab while
      it's getting closed */
   -moz-user-focus: normal;
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2730,44 +2730,44 @@
           else
             this.visible = true;
         ]]></body>
       </method>
 
       <method name="adjustTabstrip">
         <body><![CDATA[
           // modes for tabstrip
-          // 0 - activetab  = close button on active tab only
-          // 1 - alltabs    = close buttons on all tabs
-          // 2 - noclose    = no close buttons at all
-          // 3 - closeatend = close button at the end of the tabstrip
+          // 0 - button on active tab only
+          // 1 - close buttons on all tabs
+          // 2 - no close buttons at all
+          // 3 - close button at the end of the tabstrip
           switch (this.mCloseButtons) {
           case 0:
             if (this.childNodes.length == 1 && this._closeWindowWithLastTab)
-              this.setAttribute("closebuttons", "noclose");
+              this.setAttribute("closebuttons", "hidden");
             else
               this.setAttribute("closebuttons", "activetab");
             break;
           case 1:
             if (this.childNodes.length == 1) {
               if (this._closeWindowWithLastTab)
-                this.setAttribute("closebuttons", "noclose");
+                this.setAttribute("closebuttons", "hidden");
               else
                 this.setAttribute("closebuttons", "alltabs");
             } else {
               let tab = this.tabbrowser.visibleTabs[this.tabbrowser._numPinnedTabs];
               if (tab && tab.getBoundingClientRect().width > this.mTabClipWidth)
                 this.setAttribute("closebuttons", "alltabs");
               else
                 this.setAttribute("closebuttons", "activetab");
             }
             break;
           case 2:
           case 3:
-            this.setAttribute("closebuttons", "noclose");
+            this.setAttribute("closebuttons", "never");
             break;
           }
           var tabstripClosebutton = document.getElementById("tabs-closebutton");
           if (tabstripClosebutton && tabstripClosebutton.parentNode == this._container)
             tabstripClosebutton.collapsed = this.mCloseButtons != 3;
         ]]></body>
       </method>
 
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -1515,16 +1515,21 @@ toolbarbutton.chevron > .toolbarbutton-m
   -moz-margin-end: -4px;
   pointer-events: none;
 }
 
 .tab-close-button {
   pointer-events: auto;
 }
 
+.tabbrowser-tabs[closebuttons="hidden"] > * > * > * > .tab-close-button:not([pinned]) {
+  display: -moz-box;
+  visibility: hidden;
+}
+
 .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox {
   -moz-padding-start: 5px;
   -moz-padding-end: 4px;
 }
 
 .tab-content,
 .tabs-newtab-button > .toolbarbutton-icon {
   -moz-box-align: center;