Bug 1396066: Restrict :-moz-system-metric to chrome and ua sheets. r?xidorn
MozReview-Commit-ID: AyHWP3QgGlA
--- a/layout/reftests/css-mediaqueries/reftest.list
+++ b/layout/reftests/css-mediaqueries/reftest.list
@@ -11,9 +11,8 @@ fuzzy-if(Android,8,454) == mq_print_maxh
== mq_print_maxwidth.xhtml mq_print-ref.xhtml
== mq_print_maxwidth_updown.xhtml mq_print-ref.xhtml
== mq_print_maxheight_updown.xhtml mq_print-ref.xhtml
== mq_print_minheight_updown.xhtml mq_print-ref.xhtml
== mq_print_minwidth_updown.xhtml mq_print-ref.xhtml
pref(layout.css.scoped-style.enabled,true) == scoped-mq-update.html scoped-mq-update-ref.html
-== system-metrics-1.html system-metrics-1-ref.html
deleted file mode 100644
--- a/layout/reftests/css-mediaqueries/system-metrics-1-ref.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE HTML>
-<title>test for system metric media queries (reference)</title>
-<style>
-
-p { color: green; }
-
-</style>
-<p>This text should be green.</p>
deleted file mode 100644
--- a/layout/reftests/css-mediaqueries/system-metrics-1.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML>
-<title>test for system metric media queries</title>
-<style>
-
-p { color: red; }
-
-/* Exactly one of the next two should apply */
-
-@media all and (-moz-scrollbar-end-backward) {
- p:-moz-system-metric(scrollbar-end-backward) { color: green; }
-}
-
-@media not all and (-moz-scrollbar-end-backward) {
- p:not(:-moz-system-metric(scrollbar-end-backward)) { color: green; }
-}
-
-/* Neither of these should apply */
-
-@media not all and (-moz-scrollbar-end-backward) {
- p:-moz-system-metric(scrollbar-end-backward) { color: red; }
-}
-
-@media all and (-moz-scrollbar-end-backward) {
- p:not(:-moz-system-metric(scrollbar-end-backward)) { color: red; }
-}
-
-</style>
-<p>This text should be green.</p>
--- a/layout/style/nsCSSPseudoClassList.h
+++ b/layout/style/nsCSSPseudoClassList.h
@@ -96,17 +96,18 @@ CSS_PSEUDO_CLASS(mozIsHTML, ":-moz-is-ht
// purposes).
CSS_PSEUDO_CLASS(mozNativeAnonymous, ":-moz-native-anonymous",
CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS, "")
CSS_PSEUDO_CLASS(mozUseShadowTreeRoot, ":-moz-use-shadow-tree-root",
CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS, "")
// Matches anything when the specified look-and-feel metric is set
-CSS_PSEUDO_CLASS(mozSystemMetric, ":-moz-system-metric", 0, "")
+CSS_PSEUDO_CLASS(mozSystemMetric, ":-moz-system-metric",
+ CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME, "")
// -moz-locale-dir(ltr) and -moz-locale-dir(rtl) may be used
// to match based on the locale's chrome direction
CSS_PSEUDO_CLASS(mozLocaleDir, ":-moz-locale-dir", 0, "")
// -moz-lwtheme may be used to match a document that has a lightweight theme
CSS_PSEUDO_CLASS(mozLWTheme, ":-moz-lwtheme", 0, "")