Bug 926974 - [markup view] Theme does not immediately apply after switching. r=paul
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 15 Oct 2013 11:28:32 -0500
changeset 165674 a167805ff62ead9312995d5d23c385beaeabf259
parent 165673 ef3ac303c242edba805d3418947b7348c5c5bd3d
child 165675 2b2fd88833483e8acca44b040352506882f0651b
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs926974
milestone27.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 926974 - [markup view] Theme does not immediately apply after switching. r=paul
browser/devtools/shared/theme-switching.js
--- a/browser/devtools/shared/theme-switching.js
+++ b/browser/devtools/shared/theme-switching.js
@@ -30,17 +30,20 @@
       } catch(ex) {}
     }
 
     let newThemeUrl = Services.io.newURI(
       DEVTOOLS_SKIN_URL + newTheme + "-theme.css", null, null);
     winUtils.loadSheet(newThemeUrl, winUtils.AUTHOR_SHEET);
 
     // Floating scrollbars à la osx
-    if (!window.matchMedia("(-moz-overlay-scrollbars)").matches) {
+    let hiddenDOMWindow = Cc["@mozilla.org/appshell/appShellService;1"]
+                 .getService(Ci.nsIAppShellService)
+                 .hiddenDOMWindow;
+    if (!hiddenDOMWindow.matchMedia("(-moz-overlay-scrollbars)").matches) {
       let scrollbarsUrl = Services.io.newURI(
         DEVTOOLS_SKIN_URL + "floating-scrollbars-light.css", null, null);
 
       if (newTheme == "dark") {
         winUtils.loadSheet(scrollbarsUrl, winUtils.AGENT_SHEET);
       } else if (oldTheme == "dark") {
         try {
           winUtils.removeSheet(scrollbarsUrl, winUtils.AGENT_SHEET);