LibWeb: Always parse comma separated value lists as StyleValueList

Previously we would either parse these as `StyleValueList<T>` or `T`
depending on whether or not there was more than one value, this meant we
always had to handle both cases anywhere we used these values.
This commit is contained in:
Callum Law 2025-11-29 14:30:45 +13:00 committed by Sam Atkins
parent 1a5933cb04
commit e937f5db57
Notes: github-actions[bot] 2025-12-01 10:19:04 +00:00
5 changed files with 19 additions and 20 deletions

View file

@ -80,13 +80,13 @@
namespace Web::CSS::Parser {
RefPtr<StyleValue const> Parser::parse_comma_separated_value_list(TokenStream<ComponentValue>& tokens, ParseFunction parse_one_value)
RefPtr<StyleValueList const> Parser::parse_comma_separated_value_list(TokenStream<ComponentValue>& tokens, ParseFunction parse_one_value)
{
tokens.discard_whitespace();
auto first = parse_one_value(tokens);
tokens.discard_whitespace();
if (!first || !tokens.has_next_token())
return first;
if (!first)
return nullptr;
StyleValueVector values;
values.append(first.release_nonnull());