From bedab74ee38a04c9b8a8fe97e963a133ef5228c0 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Tue, 19 Nov 2024 14:11:23 +0100 Subject: [PATCH] servo: Add support for parsing `:is()` and `:where()` (#80) Stylo supports these and they just need to be turned on. Signed-off-by: Martin Robinson --- style/servo/selector_parser.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/style/servo/selector_parser.rs b/style/servo/selector_parser.rs index 5bd9c1805..f04c26587 100644 --- a/style/servo/selector_parser.rs +++ b/style/servo/selector_parser.rs @@ -494,6 +494,31 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { type Impl = SelectorImpl; type Error = StyleParseErrorKind<'i>; + #[inline] + fn parse_nth_child_of(&self) -> bool { + false + } + + #[inline] + fn parse_is_and_where(&self) -> bool { + true + } + + #[inline] + fn parse_has(&self) -> bool { + false + } + + #[inline] + fn parse_parent_selector(&self) -> bool { + false + } + + #[inline] + fn allow_forgiving_selectors(&self) -> bool { + !self.for_supports_rule + } + fn parse_non_ts_pseudo_class( &self, location: SourceLocation,