Bug 1396066: Restrict -moz-os-version to UA and chrome sheets. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 02 Oct 2017 19:42:13 +0200
changeset 674218 0ab1328c9149aab54059bc1217fc9307b0eb1ef5
parent 674217 253feabeb733d31c18458ce778aa23bd458d9eff
child 674219 b9b6e95086165abe3061e2f02ea7330f199bba78
push id82760
push userbmo:emilio@crisal.io
push dateTue, 03 Oct 2017 13:44:04 +0000
reviewersxidorn
bugs1396066
milestone58.0a1
Bug 1396066: Restrict -moz-os-version to UA and chrome sheets. r?xidorn MozReview-Commit-ID: JgH1bhlBl5g
layout/style/nsMediaFeatures.cpp
layout/style/test/test_media_queries.html
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -760,18 +760,17 @@ nsMediaFeatures::features[] = {
     nsMediaFeature::eUserAgentAndChromeOnly,
     { nullptr },
     GetWindowsTheme
   },
   {
     &nsGkAtoms::_moz_os_version,
     nsMediaFeature::eMinMaxNotAllowed,
     nsMediaFeature::eIdent,
-    // TODO(emilio): Unship.
-    nsMediaFeature::eNoRequirements,
+    nsMediaFeature::eUserAgentAndChromeOnly,
     { nullptr },
     GetOperatingSystemVersion
   },
 
   {
     &nsGkAtoms::_moz_swipe_animation_enabled,
     nsMediaFeature::eMinMaxNotAllowed,
     nsMediaFeature::eBoolInteger,
--- a/layout/style/test/test_media_queries.html
+++ b/layout/style/test/test_media_queries.html
@@ -627,22 +627,16 @@ function run() {
 
   // Assume we don't support grid devices
   should_not_apply("(grid)");
   should_apply("(grid: 0)");
   should_not_apply("(grid: 1)");
   should_not_apply("(grid: 2)");
   should_not_apply("(grid: -1)");
 
-  // 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");
-  expression_should_not_be_parseable("-moz-os-version: ");
-
   // OpenType SVG media features
   query_should_be_parseable("(-moz-is-glyph)");
   query_should_not_be_parseable("not (-moz-is-glyph)");
   query_should_not_be_parseable("only (-moz-is-glyph)");
   query_should_be_parseable("all and (-moz-is-glyph)");
   query_should_be_parseable("not all and (-moz-is-glyph)");
   query_should_be_parseable("only all and (-moz-is-glyph)");