mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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:
parent
1a5933cb04
commit
e937f5db57
Notes:
github-actions[bot]
2025-12-01 10:19:04 +00:00
Author: https://github.com/Calme1709
Commit: e937f5db57
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6972
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 19 additions and 20 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue