Bug 623669 - Minor cleanup in _positionPinnedTabs. r=gavin
authorDão Gottwald <dao@mozilla.com>
Fri, 07 Jan 2011 21:27:17 +0100
changeset 60221 8ca24ad994a264ddcf2f3bf3c74bc21f26e14421
parent 60220 f03c81553b326dbe1516998584c3d31bf98e7a2f
child 60222 019ae3c92eb4fac495920cc8fe3fa667f114825e
push id17884
push userdgottwald@mozilla.com
push dateFri, 07 Jan 2011 20:35:40 +0000
treeherdermozilla-central@019ae3c92eb4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs623669
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 623669 - Minor cleanup in _positionPinnedTabs. r=gavin
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2780,29 +2780,30 @@
                 tabStrip.scrollSize)
               tabStrip.scrollByPixels(-1);
           } catch (e) {}
         ]]></body>
       </method>
 
       <method name="_positionPinnedTabs">
         <body><![CDATA[
-          var width = 0;
-          var pinnedOnly = (this.tabbrowser._numPinnedTabs == this.tabbrowser.visibleTabs.length);
+          var numPinned = this.tabbrowser._numPinnedTabs;
+          var pinnedOnly = (numPinned == this.tabbrowser.visibleTabs.length);
 
           if (pinnedOnly)
-            this.tabbrowser.tabContainer.setAttribute("pinnedonly", "true");
+            this.setAttribute("pinnedonly", "true");
           else
-            this.tabbrowser.tabContainer.removeAttribute("pinnedonly");
+            this.removeAttribute("pinnedonly");
 
           var scrollButtonWidth = (this.getAttribute("overflow") != "true" || pinnedOnly) ? 0 :
                                   this.mTabstrip._scrollButtonDown.scrollWidth;
           var paddingStart = this.mTabstrip.scrollboxPaddingStart;
-
-          for (var i = this.tabbrowser._numPinnedTabs - 1; i >= 0; i--) {
+          var width = 0;
+
+          for (var i = numPinned - 1; i >= 0; i--) {
             let tab = this.childNodes[i];
             width += pinnedOnly ? 0 : tab.scrollWidth;
             if (this.getAttribute("overflow") != "true")
               tab.style.MozMarginStart = - (width + scrollButtonWidth) + "px";
             else
               tab.style.MozMarginStart = - (width + scrollButtonWidth + paddingStart) + "px";
           }
           if (width == 0 || this.getAttribute("overflow") != "true")