LibWeb: Fail the parsing of an invalid HSL legacy syntax

This commit is contained in:
Quentin Ligier 2024-11-01 20:25:27 +01:00 committed by Sam Atkins
parent 56441fe3e6
commit fac3ea77d8
Notes: github-actions[bot] 2024-11-04 10:49:22 +00:00

View file

@ -2861,6 +2861,9 @@ RefPtr<CSSStyleValue> Parser::parse_hsl_color_value(TokenStream<ComponentValue>&
inner_tokens.discard_whitespace();
alpha = parse_number_percentage_value(inner_tokens);
// The parser has consumed a comma, so the alpha value is now required
if (!alpha)
return {};
inner_tokens.discard_whitespace();
if (inner_tokens.has_next_token())