Bug 1396066: Restrict -moz-is-glyph to UA and chrome only. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 02 Oct 2017 19:43:04 +0200
changeset 675934 775b6182e9c032e6dffe82a23978b0d2b360deec
parent 675933 45381639c6bc9651c2fa93df8e9aae778261ed97
child 675935 4768b2a98d65b95686c9b60f09761b64891c43a3
push id83306
push userbmo:emilio@crisal.io
push dateFri, 06 Oct 2017 08:13:37 +0000
reviewersxidorn
bugs1396066
milestone58.0a1
Bug 1396066: Restrict -moz-is-glyph to UA and chrome only. r?xidorn MozReview-Commit-ID: A2Jiw8KtJSM
layout/style/nsMediaFeatures.cpp
layout/style/test/test_media_queries.html
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -796,23 +796,21 @@ nsMediaFeatures::features[] = {
     nsMediaFeature::eUserAgentAndChromeOnly,
     { &nsGkAtoms::physical_home_button },
     GetSystemMetric
   },
 
   // Internal -moz-is-glyph media feature: applies only inside SVG glyphs.
   // Internal because it is really only useful in the user agent anyway
   //  and therefore not worth standardizing.
-  //
-  // TODO(emilio): There's nothing that makes this internal at all!
   {
     &nsGkAtoms::_moz_is_glyph,
     nsMediaFeature::eMinMaxNotAllowed,
     nsMediaFeature::eBoolInteger,
-    nsMediaFeature::eNoRequirements,
+    nsMediaFeature::eUserAgentAndChromeOnly,
     { nullptr },
     GetIsGlyph
   },
   // Null-mName terminator:
   {
     nullptr,
     nsMediaFeature::eMinMaxAllowed,
     nsMediaFeature::eInteger,
--- a/layout/style/test/test_media_queries.html
+++ b/layout/style/test/test_media_queries.html
@@ -728,51 +728,42 @@ function run() {
 
   // 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
-  query_should_be_parseable("(-moz-is-glyph)");
+  query_should_not_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)");
+  query_should_not_be_parseable("all and (-moz-is-glyph)");
+  query_should_not_be_parseable("not all and (-moz-is-glyph)");
+  query_should_not_be_parseable("only all and (-moz-is-glyph)");
 
-  query_should_be_parseable("(-moz-is-glyph:0)");
+  query_should_not_be_parseable("(-moz-is-glyph:0)");
   query_should_not_be_parseable("not (-moz-is-glyph:0)");
   query_should_not_be_parseable("only (-moz-is-glyph:0)");
-  query_should_be_parseable("all and (-moz-is-glyph:0)");
-  query_should_be_parseable("not all and (-moz-is-glyph:0)");
-  query_should_be_parseable("only all and (-moz-is-glyph:0)");
+  query_should_not_be_parseable("all and (-moz-is-glyph:0)");
+  query_should_not_be_parseable("not all and (-moz-is-glyph:0)");
+  query_should_not_be_parseable("only all and (-moz-is-glyph:0)");
 
-  query_should_be_parseable("(-moz-is-glyph:1)");
+  query_should_not_be_parseable("(-moz-is-glyph:1)");
   query_should_not_be_parseable("not (-moz-is-glyph:1)");
   query_should_not_be_parseable("only (-moz-is-glyph:1)");
-  query_should_be_parseable("all and (-moz-is-glyph:1)");
-  query_should_be_parseable("not all and (-moz-is-glyph:1)");
-  query_should_be_parseable("only all and (-moz-is-glyph:1)");
+  query_should_not_be_parseable("all and (-moz-is-glyph:1)");
+  query_should_not_be_parseable("not all and (-moz-is-glyph:1)");
+  query_should_not_be_parseable("only all and (-moz-is-glyph:1)");
 
   query_should_not_be_parseable("(min--moz-is-glyph:0)");
   query_should_not_be_parseable("(max--moz-is-glyph:0)");
   query_should_not_be_parseable("(min--moz-is-glyph:1)");
   query_should_not_be_parseable("(max--moz-is-glyph:1)");
 
-  should_apply("not all and (-moz-is-glyph)");
-  should_apply("(-moz-is-glyph:0)");
-  should_apply("not all and (-moz-is-glyph:1)");
-  should_apply("only all and (-moz-is-glyph:0)");
-  should_not_apply("(-moz-is-glyph)");
-  should_not_apply("(-moz-is-glyph:1)");
-  should_not_apply("not all and (-moz-is-glyph:0)");
-  should_not_apply("only all and (-moz-is-glyph:1)");
-
   // Parsing tests
   // bug 454227
   should_apply_unbalanced("(orientation");
   should_not_apply_unbalanced("not all and (orientation");
   should_not_apply_unbalanced("(orientation:");
   should_apply_unbalanced("all,(orientation:");
   should_not_apply_unbalanced("(orientation:,all");
   should_apply_unbalanced("not all and (grid");