mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
LibWeb: Throw parsing error if ::slotted()
argument is not 1 compound
...selector. Grammar per spec: `::slotted( <compound-selector> )`, so we should reject selector as invalid if first compound selector is followed by something else. This change makes layout more correct on https://www.rottentomatoes.com/
This commit is contained in:
parent
27caa1e175
commit
308c2eab0e
Notes:
github-actions[bot]
2025-09-04 12:56:37 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 308c2eab0e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6068
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 54 additions and 0 deletions
|
@ -517,6 +517,15 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_pseudo_simple_selec
|
|||
});
|
||||
return ParseError::SyntaxError;
|
||||
}
|
||||
function_tokens.discard_whitespace();
|
||||
if (function_tokens.has_next_token()) {
|
||||
ErrorReporter::the().report(InvalidPseudoClassOrElementError {
|
||||
.name = MUST(String::formatted("::{}", pseudo_name)),
|
||||
.value_string = name_token.to_string(),
|
||||
.description = "Trailing tokens after compound selector argument."_string,
|
||||
});
|
||||
return ParseError::SyntaxError;
|
||||
}
|
||||
|
||||
auto compound_selector = compound_selector_or_error.release_value().release_value();
|
||||
compound_selector.combinator = Selector::Combinator::None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue