Bug 1356655 - Let adjustTabstrip return early if the tab strip is overflowing. r?florian
MozReview-Commit-ID: LKYuFidCHWa
--- 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