Bug 1468854: Restrict -moz-is-resource-document to UA and chrome stylesheets. r?mats
MozReview-Commit-ID: 3vpNtgdy0yl
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -840,17 +840,17 @@ nsMediaFeatures::features[] = {
nsMediaFeature::eNoRequirements,
{ kOrientationKeywords },
GetDeviceOrientation
},
{
&nsGkAtoms::_moz_is_resource_document,
nsMediaFeature::eMinMaxNotAllowed,
nsMediaFeature::eBoolInteger,
- nsMediaFeature::eNoRequirements,
+ nsMediaFeature::eUserAgentAndChromeOnly,
{ nullptr },
GetIsResourceDocument
},
{
&nsGkAtoms::_moz_scrollbar_start_backward,
nsMediaFeature::eMinMaxNotAllowed,
nsMediaFeature::eBoolInteger,
nsMediaFeature::eUserAgentAndChromeOnly,
--- a/layout/style/test/test_media_queries.html
+++ b/layout/style/test/test_media_queries.html
@@ -787,16 +787,19 @@ function run() {
should_not_apply("(-moz-is-glyph:0)");
should_not_apply("not all and (-moz-is-glyph:1)");
should_not_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)");
+ // Resource documents (UA-only).
+ query_should_not_be_parseable("(-moz-is-resource-document)");
+
// 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");