From 73a9c57c3b1cda7fcff806aec3c180aaea0d6195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 12 Aug 2020 04:26:07 +0000 Subject: [PATCH] style: Implement :-moz-any() as an alias of :is(). This is strictly better and more flexible, but can change specificity so have a pref in case it causes trouble. I doubt it will though, the specificity rules of :is() make more sense, and my gut feeling is that :-moz-any is not very used on the wild. Make it early-beta-or-earlier for now to minimize risk, once this is on nightly for a bit we can enable it everywhere. Differential Revision: https://phabricator.services.mozilla.com/D86696 --- components/style/gecko/selector_parser.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index d0f5c57b567..844991a427b 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -352,6 +352,12 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { true } + #[inline] + fn is_is_alias(&self, function: &str) -> bool { + static_prefs::pref!("layout.css.moz-any-is-is.enabled") && + function.eq_ignore_ascii_case("-moz-any") + } + fn parse_non_ts_pseudo_class( &self, location: SourceLocation,