Bug 1445737: Update tabsintitlebar stuff before layout. r=dao draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 15 Mar 2018 00:44:58 +0100
changeset 768502 e53fd7c43960b12dd5bcd0d5b5b6739512122181
parent 768501 fdda0ebb7ce82a66b210432538efac5c7d748919
child 768509 f207b26a44cdfef6d46327f72835731508ef7be3
push id102880
push userbmo:emilio@crisal.io
push dateFri, 16 Mar 2018 10:59:26 +0000
reviewersdao
bugs1445737, 1439875
milestone61.0a1
Bug 1445737: Update tabsintitlebar stuff before layout. r=dao Not doing can it cause perf issues, but old Linux distros aren't really happy about it, and they barf when the chromemargin is removed dynamically, so prevent that happening by default. Right now it happens on the resize we do right before loading the window, but that will stop working after bug 1439875. MozReview-Commit-ID: 1Rhaz07fHaY
browser/base/content/browser.js
browser/base/content/tabbrowser.xml
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1224,16 +1224,19 @@ var gBrowserInit = {
 
       document.documentElement.setAttribute("width", width);
       document.documentElement.setAttribute("height", height);
 
       if (width < TARGET_WIDTH && height < TARGET_HEIGHT) {
         document.documentElement.setAttribute("sizemode", "maximized");
       }
     }
+
+    TabsInTitlebar.init();
+    TabsInTitlebar.updateAppearance();
   },
 
   onDOMContentLoaded() {
     gBrowser = window._gBrowser;
     delete window._gBrowser;
     gBrowser.init();
 
     window.QueryInterface(Ci.nsIInterfaceRequestor)
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -751,17 +751,16 @@
       </method>
 
       <method name="handleEvent">
         <parameter name="aEvent"/>
         <body><![CDATA[
           switch (aEvent.type) {
             case "DOMContentLoaded":
               this.updateVisibility();
-              TabsInTitlebar.init();
               break;
             case "resize":
               if (aEvent.target != window)
                 break;
 
               TabsInTitlebar.updateAppearance();
               this._updateCloseButtons();
               this._handleTabSelect(true);