LibWeb/CSS: Make :has() take a <relative-selector-list>

The spec changed this at some point.
This commit is contained in:
Sam Atkins 2024-11-14 11:22:46 +00:00 committed by Andreas Kling
commit ad1f93504e
Notes: github-actions[bot] 2024-11-14 19:08:42 +00:00
7 changed files with 40 additions and 14 deletions

View file

@ -641,9 +641,13 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_pseudo_simple_selec
.languages = move(languages) }
};
}
case PseudoClassMetadata::ParameterType::RelativeSelectorList:
case PseudoClassMetadata::ParameterType::SelectorList: {
auto function_token_stream = TokenStream(pseudo_function.value);
auto not_selector = TRY(parse_a_selector_list(function_token_stream, SelectorType::Standalone));
auto selector_type = metadata.parameter_type == PseudoClassMetadata::ParameterType::SelectorList
? SelectorType::Standalone
: SelectorType::Relative;
auto not_selector = TRY(parse_a_selector_list(function_token_stream, selector_type));
return Selector::SimpleSelector {
.type = Selector::SimpleSelector::Type::PseudoClass,