Bug 1356655 - Let adjustTabstrip return early if the tab strip is overflowing. r=florian
authorDão Gottwald <dao@mozilla.com>
Sun, 16 Apr 2017 17:08:42 +0200
changeset 353636 7640ebe4a0e24c7423c3d2e3db454ca819c5065a
parent 353635 468bdb0188e8c107c839878a49f95d7d29ed301b
child 353637 09fd41bb16e4d1ba8bdd825c657f7afa8505cb07
push id40990
push userdgottwald@mozilla.com
push dateTue, 18 Apr 2017 19:00:01 +0000
treeherderautoland@7640ebe4a0e2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1356655
milestone55.0a1
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 1356655 - Let adjustTabstrip return early if the tab strip is overflowing. r=florian MozReview-Commit-ID: LKYuFidCHWa
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -5904,16 +5904,22 @@
             this.visible = window.toolbar.visible;
           else
             this.visible = true;
         ]]></body>
       </method>
 
       <method name="adjustTabstrip">
         <body><![CDATA[
+          // If we're overflowing, tab widths don't change anymore, so we can
+          // return early to avoid flushing layout.
+          if (this.getAttribute("overflow") == "true") {
+            return;
+          }
+
           let numTabs = this.childNodes.length -
                         this.tabbrowser._removingTabs.length;
           if (numTabs > 2) {
             // This is an optimization to avoid layout flushes by calling
             // getBoundingClientRect() when we just opened a second tab. In
             // this case it's highly unlikely that the tab width is smaller
             // than mTabClipWidth and the tab close button obscures too much
             // of the tab's label. In the edge case of the window being too