Bug 1468854: Restrict -moz-is-resource-document to UA and chrome stylesheets. r?mats draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 14 Jun 2018 14:39:38 -0700
changeset 807553 f818f2137e25415f7c6b59e7e0def4e0e3897324
parent 807552 ec583f9ecd863300ee97cfea658dfa4fd75b15cc
push id113149
push userbmo:emilio@crisal.io
push dateThu, 14 Jun 2018 21:46:05 +0000
reviewersmats
bugs1468854
milestone62.0a1
Bug 1468854: Restrict -moz-is-resource-document to UA and chrome stylesheets. r?mats MozReview-Commit-ID: 3vpNtgdy0yl
layout/style/nsMediaFeatures.cpp
layout/style/test/test_media_queries.html
--- 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");