Bug 1356655 - Let adjustTabstrip return early if the tab strip is overflowing. r?florian draft
authorDão Gottwald <dao@mozilla.com>
Sun, 16 Apr 2017 17:08:42 +0200
changeset 563367 c841dac1bc5565fb44e5a9f70d9be8c6bead36e8
parent 563120 9379831bb9c3d9abfea7dbf8dd06dbdab1d81dc4
child 624444 225014c5327b9bf8a22f627b083de4963047fbb6
push id54267
push userdgottwald@mozilla.com
push dateSun, 16 Apr 2017 15:13:08 +0000
reviewersflorian
bugs1356655
milestone55.0a1
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
@@ -5924,16 +5924,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