Bug 1396066: Restrict -moz-is-glyph to UA and chrome only. r?xidorn
MozReview-Commit-ID: A2Jiw8KtJSM
--- 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");