mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibWeb: Require CSS combinators to be followed by a simple selector
This commit is contained in:
@@ -166,8 +166,12 @@ Parser::ParseErrorOr<Optional<Selector::CompoundSelector>> Parser::parse_compoun
|
||||
simple_selectors.append(component.release_value());
|
||||
}
|
||||
|
||||
if (simple_selectors.is_empty())
|
||||
if (simple_selectors.is_empty()) {
|
||||
if (tokens.has_next_token() || combinator != Selector::Combinator::Descendant)
|
||||
return ParseError::SyntaxError;
|
||||
|
||||
return Optional<Selector::CompoundSelector> {};
|
||||
}
|
||||
|
||||
return Selector::CompoundSelector { combinator, move(simple_selectors) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user