Bug 1396066: Restrict -moz-windows-theme and -moz-os-version to UA and chrome only. r=xidorn

MozReview-Commit-ID: 9iEhkcZb52C
This commit is contained in:
Emilio Cobos Álvarez 2017-10-02 19:41:46 +02:00
Родитель 4efbb7d1dd
Коммит 81f719cb23
3 изменённых файлов: 20 добавлений и 27 удалений

Просмотреть файл

@ -767,8 +767,7 @@ nsMediaFeatures::features[] = {
&nsGkAtoms::_moz_windows_theme,
nsMediaFeature::eMinMaxNotAllowed,
nsMediaFeature::eIdent,
// TODO(emilio): Unship.
nsMediaFeature::eNoRequirements,
nsMediaFeature::eUserAgentAndChromeOnly,
{ nullptr },
GetWindowsTheme
},
@ -776,8 +775,7 @@ nsMediaFeatures::features[] = {
&nsGkAtoms::_moz_os_version,
nsMediaFeature::eMinMaxNotAllowed,
nsMediaFeature::eIdent,
// TODO(emilio): Unship.
nsMediaFeature::eNoRequirements,
nsMediaFeature::eUserAgentAndChromeOnly,
{ nullptr },
GetOperatingSystemVersion
},

Просмотреть файл

@ -128,12 +128,7 @@ var testWindowsSpecific = function (resisting, queryName, possibleValues) {
foundValue = val;
}
});
if (resisting) {
ok(!foundValue, queryName + " should have no match");
} else {
ok(foundValue, foundValue ? ("Match found: '" + queryName + ":" + foundValue + "'")
: "Should have a match for '" + queryName + "'");
}
ok(!foundValue, queryName + " should have no match");
};
// __generateHtmlLines(resisting)__.
@ -211,11 +206,11 @@ var generateCSSLines = function (resisting) {
lines += suppressedMediaQueryCSSLine(key, color);
});
if (OS === "WINNT") {
lines += ".windows { background-color: " + (resisting ? "green" : "red") + ";}\n";
lines += ".windows { background-color: green; }\n";
lines += windows_versions.map(val => "(-moz-os-version: " + val + ")").join(", ") +
" { #-moz-os-version { background-color: " + (resisting ? "red" : "green") + ";} }\n";
" { #-moz-os-version { background-color: red; } }\n";
lines += windows_themes.map(val => "(-moz-windows-theme: " + val + ")").join(",") +
" { #-moz-windows-theme { background-color: " + (resisting ? "red" : "green") + ";} }\n";
" { #-moz-windows-theme { background-color: red; }\n";
}
return lines;
};

Просмотреть файл

@ -713,23 +713,23 @@ function run() {
expression_should_not_be_parseable("-moz-touch-enabled: true");
expression_should_not_be_parseable("-moz-swipe-animation-enabled: true");
// windows theme media queries
expression_should_be_parseable("-moz-windows-theme: aero");
expression_should_be_parseable("-moz-windows-theme: aero-lite");
expression_should_be_parseable("-moz-windows-theme: luna-blue");
expression_should_be_parseable("-moz-windows-theme: luna-olive");
expression_should_be_parseable("-moz-windows-theme: luna-silver");
expression_should_be_parseable("-moz-windows-theme: royale");
expression_should_be_parseable("-moz-windows-theme: generic");
expression_should_be_parseable("-moz-windows-theme: zune");
expression_should_be_parseable("-moz-windows-theme: garbage");
// windows theme media queries (internal too, so not parseable).
expression_should_not_be_parseable("-moz-windows-theme: aero");
expression_should_not_be_parseable("-moz-windows-theme: aero-lite");
expression_should_not_be_parseable("-moz-windows-theme: luna-blue");
expression_should_not_be_parseable("-moz-windows-theme: luna-olive");
expression_should_not_be_parseable("-moz-windows-theme: luna-silver");
expression_should_not_be_parseable("-moz-windows-theme: royale");
expression_should_not_be_parseable("-moz-windows-theme: generic");
expression_should_not_be_parseable("-moz-windows-theme: zune");
expression_should_not_be_parseable("-moz-windows-theme: garbage");
expression_should_not_be_parseable("-moz-windows-theme: ''");
expression_should_not_be_parseable("-moz-windows-theme: ");
// os version media queries (currently windows only)
expression_should_be_parseable("-moz-os-version: windows-win7");
expression_should_be_parseable("-moz-os-version: windows-win8");
expression_should_be_parseable("-moz-os-version: windows-win10");
// os version media queries (currently windows only, and internal)
expression_should_not_be_parseable("-moz-os-version: windows-win7");
expression_should_not_be_parseable("-moz-os-version: windows-win8");
expression_should_not_be_parseable("-moz-os-version: windows-win10");
expression_should_not_be_parseable("-moz-os-version: ");
// OpenType SVG media features