Backed out changeset ecaae0733ca1 (bug 1383367)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 30 Jul 2017 12:54:02 +0200
changeset 423019 7051e8c01179ae255a323197e1e1c32d832e20d7
parent 423018 8b577b152383f5560ab57fdc307fa872cd268ea7
child 423020 c23906663721688473844f931bbc59de938517f2
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1383367
milestone56.0a1
backs outecaae0733ca1dc08db7e8defe5c572f8d708d8a6
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 ecaae0733ca1 (bug 1383367) MozReview-Commit-ID: 2lnZ8OUnXnG
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
@@ -8712,17 +8712,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));
     }
 
@@ -8749,32 +8749,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
@@ -27,33 +27,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(
       [
         "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(
     [
       "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(
     [
       "verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
@@ -66,20 +62,18 @@ if (Services.appinfo.OS == "WINNT") {
       "verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
       "_update@chrome://browser/content/browser-tabsintitlebar.js",
       "updateAppearance@chrome://browser/content/browser-tabsintitlebar.js",
       "handleEvent@chrome://browser/content/tabbrowser.xml",
     ],
 
     [
       "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",
     ],
 
     [
       "handleEvent@chrome://browser/content/tabbrowser.xml",
       "EventListener.handleEvent*tabbrowser-tabs_XBL_Constructor@chrome://browser/content/tabbrowser.xml",
     ],
   );
 }