Bug 1314091 - Backed out changeset 60d0080b95fe (bug 1308407)
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 13 Jan 2017 11:53:58 -0800
changeset 374411 05090352ae09536a4410d01bb833a9a22c5bd1c4
parent 374410 fb6a2290e35d17db060dfe3c541ca04f3a6f9230
child 374412 cef98a724789cf19e9f4b784ac594fa3a3885cf2
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1314091, 1308407
milestone53.0a1
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
Bug 1314091 - Backed out changeset 60d0080b95fe (bug 1308407) We won't need this anymore, since there will be a separate light and dark theme definition, so we can update the theme definition to allow the brightness to be inferred automatically by the lightweight theming system. MozReview-Commit-ID: 3GuZ3Qezc1F
browser/base/content/browser-devedition.js
--- a/browser/base/content/browser-devedition.js
+++ b/browser/base/content/browser-devedition.js
@@ -20,17 +20,16 @@ var DevEdition = {
     let theme = LightweightThemeManager.currentTheme;
     return theme && theme.id == "firefox-devedition@mozilla.org";
   },
 
   init() {
     this.initialized = true;
     Services.prefs.addObserver(this._devtoolsThemePrefName, this, false);
     Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
-    Services.obs.addObserver(this, "lightweight-theme-window-updated", false);
     this._updateDevtoolsThemeAttribute();
 
     if (this.isThemeCurrentlyApplied) {
       this._toggleStyleSheet(true);
     }
   },
 
   createStyleSheet() {
@@ -45,18 +44,16 @@ var DevEdition = {
   observe(subject, topic, data) {
     if (topic == "lightweight-theme-styling-update") {
       let newTheme = JSON.parse(data);
       if (newTheme && newTheme.id == "firefox-devedition@mozilla.org") {
         this._toggleStyleSheet(true);
       } else {
         this._toggleStyleSheet(false);
       }
-    } else if (topic == "lightweight-theme-window-updated" && subject == window) {
-      this._updateLWTBrightness();
     }
 
     if (topic == "nsPref:changed" && data == this._devtoolsThemePrefName) {
       this._updateDevtoolsThemeAttribute();
     }
   },
 
   _inferBrightness() {
@@ -65,33 +62,24 @@ var DevEdition = {
     if (this.isStyleSheetEnabled &&
         document.documentElement.getAttribute("devtoolstheme") == "dark") {
       document.documentElement.setAttribute("brighttitlebarforeground", "true");
     } else {
       document.documentElement.removeAttribute("brighttitlebarforeground");
     }
   },
 
-  _updateLWTBrightness() {
-    if (this.isThemeCurrentlyApplied) {
-      let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName);
-      let textColor = devtoolsTheme == "dark" ? "bright" : "dark";
-      document.documentElement.setAttribute("lwthemetextcolor", textColor);
-    }
-  },
-
   _updateDevtoolsThemeAttribute() {
     // Set an attribute on root element to make it possible
     // to change colors based on the selected devtools theme.
     let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName);
     if (devtoolsTheme != "dark") {
       devtoolsTheme = "light";
     }
     document.documentElement.setAttribute("devtoolstheme", devtoolsTheme);
-    this._updateLWTBrightness();
     this._inferBrightness();
   },
 
   handleEvent(e) {
     if (e.type === "load") {
       this.styleSheet.removeEventListener("load", this);
       this.refreshBrowserDisplay();
     }
@@ -120,17 +108,16 @@ var DevEdition = {
       this.styleSheet.sheet.disabled = true;
       this.refreshBrowserDisplay();
     }
   },
 
   uninit() {
     Services.prefs.removeObserver(this._devtoolsThemePrefName, this);
     Services.obs.removeObserver(this, "lightweight-theme-styling-update");
-    Services.obs.removeObserver(this, "lightweight-theme-window-updated");
     if (this.styleSheet) {
       this.styleSheet.removeEventListener("load", this);
     }
     this.styleSheet = null;
   }
 };
 
 // If the DevEdition theme is going to be applied in gBrowserInit.onLoad,