mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-18 08:11:53 +00:00
LibWeb/CSS: Take custom-ident blacklist as a Span
Using std::initializer_list here was a bit of a hack, and makes it awkward to pass those blacklists around.
This commit is contained in:
parent
9585c6c0c7
commit
c6c607884b
Notes:
github-actions[bot]
2025-02-26 11:24:19 +00:00
Author: https://github.com/AtkinsSJ
Commit: c6c607884b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3684
Reviewed-by: https://github.com/trflynn89
3 changed files with 7 additions and 7 deletions
|
@ -1796,7 +1796,7 @@ RefPtr<CSSStyleValue> Parser::parse_counter_value(TokenStream<ComponentValue>& t
|
|||
auto transaction = tokens.begin_transaction();
|
||||
tokens.discard_whitespace();
|
||||
|
||||
auto counter_name = parse_custom_ident_value(tokens, { "none"sv });
|
||||
auto counter_name = parse_custom_ident_value(tokens, { { "none"sv } });
|
||||
if (!counter_name)
|
||||
return {};
|
||||
|
||||
|
@ -1817,7 +1817,7 @@ RefPtr<CSSStyleValue> Parser::parse_counter_value(TokenStream<ComponentValue>& t
|
|||
auto transaction = tokens.begin_transaction();
|
||||
tokens.discard_whitespace();
|
||||
|
||||
auto counter_style_name = parse_custom_ident_value(tokens, { "none"sv });
|
||||
auto counter_style_name = parse_custom_ident_value(tokens, { { "none"sv } });
|
||||
if (!counter_style_name)
|
||||
return {};
|
||||
|
||||
|
@ -2812,7 +2812,7 @@ RefPtr<CSSStyleValue> Parser::parse_builtin_value(TokenStream<ComponentValue>& t
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/css-values-4/#custom-idents
|
||||
RefPtr<CustomIdentStyleValue> Parser::parse_custom_ident_value(TokenStream<ComponentValue>& tokens, std::initializer_list<StringView> blacklist)
|
||||
RefPtr<CustomIdentStyleValue> Parser::parse_custom_ident_value(TokenStream<ComponentValue>& tokens, ReadonlySpan<StringView> blacklist)
|
||||
{
|
||||
auto transaction = tokens.begin_transaction();
|
||||
tokens.discard_whitespace();
|
||||
|
@ -3096,7 +3096,7 @@ RefPtr<GridTrackPlacementStyleValue> Parser::parse_grid_track_placement(TokenStr
|
|||
};
|
||||
auto parse_custom_ident = [this](auto& tokens) {
|
||||
// The <custom-ident> additionally excludes the keywords span and auto.
|
||||
return parse_custom_ident_value(tokens, { "span"sv, "auto"sv });
|
||||
return parse_custom_ident_value(tokens, { { "span"sv, "auto"sv } });
|
||||
};
|
||||
|
||||
auto transaction = tokens.begin_transaction();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue