Bug 1050229 - Use matchMedia when computing the value for the windowsDefaultTheme reftest variable. r=ehsan

This commit is contained in:
Markus Stange 2014-08-08 12:46:48 +02:00
parent 2e87873593
commit 00908ae029
3 changed files with 1 additions and 21 deletions

View File

@ -2,14 +2,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet type="text/css" href="data:text/css,
%23_box_windowsDefaultTheme:-moz-system-metric(windows-default-theme) {
display: none;
}
" ?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="recording-window"
hidechrome="true"

View File

@ -689,11 +689,7 @@ function BuildConditionSandbox(aURL) {
sandbox.haveTestPlugin = !!testPlugin && !gBrowserIsRemote;
// Set a flag on sandbox if the windows default theme is active
var box = gContainingWindow.document.createElement("box");
box.setAttribute("id", "_box_windowsDefaultTheme");
gContainingWindow.document.documentElement.appendChild(box);
sandbox.windowsDefaultTheme = (gContainingWindow.getComputedStyle(box, null).display == "none");
gContainingWindow.document.documentElement.removeChild(box);
sandbox.windowsDefaultTheme = gContainingWindow.matchMedia("(-moz-windows-default-theme)").matches;
var prefs = CC["@mozilla.org/preferences-service;1"].
getService(CI.nsIPrefBranch);

View File

@ -2,14 +2,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet type="text/css" href="data:text/css,
%23_box_windowsDefaultTheme:-moz-system-metric(windows-default-theme) {
display: none;
}
" ?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="reftest-window"
hidechrome="true"