mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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
This commit is contained in:
parent
919ff06445
commit
9ce200a924
1 changed files with 9 additions and 0 deletions
|
@ -254,6 +254,11 @@ pub trait Parser<'i> {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Whether the given function name is an alias for the `:is()` function.
|
||||||
|
fn is_is_alias(&self, _name: &str) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
/// Whether to parse the `:host` pseudo-class.
|
/// Whether to parse the `:host` pseudo-class.
|
||||||
fn parse_host(&self) -> bool {
|
fn parse_host(&self) -> bool {
|
||||||
false
|
false
|
||||||
|
@ -2302,6 +2307,10 @@ where
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if parser.parse_is_and_where() && parser.is_is_alias(&name) {
|
||||||
|
return parse_is_or_where(parser, input, state, Component::Is);
|
||||||
|
}
|
||||||
|
|
||||||
if !state.allows_custom_functional_pseudo_classes() {
|
if !state.allows_custom_functional_pseudo_classes() {
|
||||||
return Err(input.new_custom_error(SelectorParseErrorKind::InvalidState));
|
return Err(input.new_custom_error(SelectorParseErrorKind::InvalidState));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue