mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Require CSS combinators to be followed by a simple selector
This commit is contained in:
parent
bb5678a175
commit
a2cf1d17fd
Notes:
github-actions[bot]
2024-11-23 08:51:39 +00:00
Author: https://github.com/Gingeh
Commit: a2cf1d17fd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2478
Reviewed-by: https://github.com/AtkinsSJ
2 changed files with 27 additions and 23 deletions
|
@ -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) };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue