From 274c46a3c97e1f9969d18b7704ced4c39770e152 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 23 Jul 2024 15:03:27 +0200 Subject: [PATCH] LibWeb: Don't infer descendant combinator for This fixes an issue where :host(foo) would parse as if "foo" was the on the right side of a descendant combinator. Not testable yet, but will be in the next commit. --- Userland/Libraries/LibWeb/CSS/Parser/SelectorParsing.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/SelectorParsing.cpp b/Userland/Libraries/LibWeb/CSS/Parser/SelectorParsing.cpp index 3a52edb7bd5..676257fd5c5 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/SelectorParsing.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/SelectorParsing.cpp @@ -506,7 +506,10 @@ Parser::ParseErrorOr Parser::parse_pseudo_simple_selec return ParseError::SyntaxError; } - Vector compound_selectors { compound_selector_or_error.release_value().release_value() }; + auto compound_selector = compound_selector_or_error.release_value().release_value(); + compound_selector.combinator = Selector::Combinator::None; + + Vector compound_selectors { move(compound_selector) }; auto selector = Selector::create(move(compound_selectors)); return Selector::SimpleSelector {