From 8ac3f064ac076cdef12ea0fc0c5ad92a239b0b7a Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Wed, 25 Sep 2024 15:47:54 +0200 Subject: [PATCH] servo: Add support for parsing `:is()`, `:has()`, `:where()`, and nesting selectors Stylo supports these and they just need to be turned on. Signed-off-by: Martin Robinson --- style/servo/selector_parser.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/style/servo/selector_parser.rs b/style/servo/selector_parser.rs index 5bd9c1805..670526a73 100644 --- a/style/servo/selector_parser.rs +++ b/style/servo/selector_parser.rs @@ -494,6 +494,26 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { type Impl = SelectorImpl; type Error = StyleParseErrorKind<'i>; + #[inline] + fn parse_nth_child_of(&self) -> bool { + true + } + + #[inline] + fn parse_is_and_where(&self) -> bool { + true + } + + #[inline] + fn parse_has(&self) -> bool { + true + } + + #[inline] + fn parse_parent_selector(&self) -> bool { + true + } + fn parse_non_ts_pseudo_class( &self, location: SourceLocation,