Backed out changeset 1f9ec3827494 (bug 1383367)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 28 Jul 2017 09:45:16 +0200
changeset 420311 466818a625e91a40818d3467a80d0befd26a4038
parent 420310 a57d8f30d1bf5de3ba5201a6f5e2a08ef1cf7d85
child 420312 f74d81e43bb5b9b13a6fd5351205582949f97870
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1383367
milestone56.0a1
backs out1f9ec38274940ff20a1bfc0a6b8c76ea5ae16cff
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
Backed out changeset 1f9ec3827494 (bug 1383367)
browser/base/content/browser.js
browser/base/content/test/performance/browser_windowopen_reflows.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -8709,17 +8709,17 @@ var ToolbarIconColor = {
         break;
     }
   },
 
   // a cache of luminance values for each toolbar
   // to avoid unnecessary calls to getComputedStyle
   _toolbarLuminanceCache: new Map(),
 
-  async inferFromText(reason, reasonValue) {
+  inferFromText(reason, reasonValue) {
     if (!this._initialized)
       return;
     function parseRGB(aColorString) {
       let rgb = aColorString.match(/^rgba?\((\d+), (\d+), (\d+)/);
       rgb.shift();
       return rgb.map(x => parseInt(x));
     }
 
@@ -8746,32 +8746,30 @@ var ToolbarIconColor = {
     let toolbarSelector = "#navigator-toolbox > toolbar:not([collapsed=true]):not(#addon-bar)";
     if (AppConstants.platform == "macosx")
       toolbarSelector += ":not([type=menubar])";
 
     // The getComputedStyle calls and setting the brighttext are separated in
     // two loops to avoid flushing layout and making it dirty repeatedly.
     let cachedLuminances = this._toolbarLuminanceCache;
     let luminances = new Map();
-    await BrowserUtils.promiseLayoutFlushed(document, "style", () => {
-      for (let toolbar of document.querySelectorAll(toolbarSelector)) {
-        // toolbars *should* all have ids, but guard anyway to avoid blowing up
-        let cacheKey = toolbar.id && toolbar.id + JSON.stringify(this._windowState);
-        // lookup cached luminance value for this toolbar in this window state
-        let luminance = cacheKey && cachedLuminances.get(cacheKey);
-        if (isNaN(luminance)) {
-          let [r, g, b] = parseRGB(getComputedStyle(toolbar).color);
-          luminance = 0.2125 * r + 0.7154 * g + 0.0721 * b;
-          if (cacheKey) {
-            cachedLuminances.set(cacheKey, luminance);
-          }
+    for (let toolbar of document.querySelectorAll(toolbarSelector)) {
+      // toolbars *should* all have ids, but guard anyway to avoid blowing up
+      let cacheKey = toolbar.id && toolbar.id + JSON.stringify(this._windowState);
+      // lookup cached luminance value for this toolbar in this window state
+      let luminance = cacheKey && cachedLuminances.get(cacheKey);
+      if (isNaN(luminance)) {
+        let [r, g, b] = parseRGB(getComputedStyle(toolbar).color);
+        luminance = 0.2125 * r + 0.7154 * g + 0.0721 * b;
+        if (cacheKey) {
+          cachedLuminances.set(cacheKey, luminance);
         }
-        luminances.set(toolbar, luminance);
       }
-    });
+      luminances.set(toolbar, luminance);
+    }
 
     for (let [toolbar, luminance] of luminances) {
       if (luminance <= 110)
         toolbar.removeAttribute("brighttext");
       else
         toolbar.setAttribute("brighttext", "true");
     }
   }
--- a/browser/base/content/test/performance/browser_windowopen_reflows.js
+++ b/browser/base/content/test/performance/browser_windowopen_reflows.js
@@ -29,33 +29,29 @@ if (Services.appinfo.OS == "Linux") {
         "handleEvent@chrome://browser/content/tabbrowser.xml",
         "EventListener.handleEvent*tabbrowser-tabs_XBL_Constructor@chrome://browser/content/tabbrowser.xml",
       ],
     });
   } else {
     EXPECTED_REFLOWS.push({
       stack: [
         "handleEvent@chrome://browser/content/tabbrowser.xml",
-        "inferFromText/<@chrome://browser/content/browser.js",
-        "promiseReflowed/</<@resource://gre/modules/BrowserUtils.jsm",
-        "_onReflow@resource://gre/modules/BrowserUtils.jsm",
-        "reflowInterruptible@resource://gre/modules/BrowserUtils.jsm",
+        "inferFromText@chrome://browser/content/browser.js",
+        "handleEvent@chrome://browser/content/browser.js",
       ],
     });
   }
 }
 
 if (Services.appinfo.OS == "Darwin") {
   EXPECTED_REFLOWS.push({
     stack: [
       "handleEvent@chrome://browser/content/tabbrowser.xml",
-      "inferFromText/<@chrome://browser/content/browser.js",
-      "promiseReflowed/</<@resource://gre/modules/BrowserUtils.jsm",
-      "_onReflow@resource://gre/modules/BrowserUtils.jsm",
-      "reflowInterruptible@resource://gre/modules/BrowserUtils.jsm",
+      "inferFromText@chrome://browser/content/browser.js",
+      "handleEvent@chrome://browser/content/browser.js",
     ],
   });
 }
 
 if (Services.appinfo.OS == "WINNT") {
   EXPECTED_REFLOWS.push(
     {
       stack: [
@@ -65,20 +61,18 @@ if (Services.appinfo.OS == "WINNT") {
         "handleEvent@chrome://browser/content/tabbrowser.xml",
       ],
       times: 2, // This number should only ever go down - never up.
     },
 
     {
       stack: [
         "handleEvent@chrome://browser/content/tabbrowser.xml",
-        "inferFromText/<@chrome://browser/content/browser.js",
-        "promiseReflowed/</<@resource://gre/modules/BrowserUtils.jsm",
-        "_onReflow@resource://gre/modules/BrowserUtils.jsm",
-        "reflowInterruptible@resource://gre/modules/BrowserUtils.jsm",
+        "inferFromText@chrome://browser/content/browser.js",
+        "handleEvent@chrome://browser/content/browser.js",
       ],
     },
 
     {
       stack: [
         "handleEvent@chrome://browser/content/tabbrowser.xml",
         "EventListener.handleEvent*tabbrowser-tabs_XBL_Constructor@chrome://browser/content/tabbrowser.xml",
       ],