LibWeb+Meta: Don't require the custom ident blacklist parameter

With a default parameter, we can avoid having to store None for the
blacklist when it's not applicable.
This commit is contained in:
Zaggy1024 2026-04-29 17:07:17 -05:00 committed by Jelle Raaijmakers
parent d253d53b29
commit ccaaefbf27
4 changed files with 4 additions and 4 deletions

View file

@ -390,7 +390,7 @@ private:
Optional<PropertyAndValue> parse_css_value_for_properties(ReadonlySpan<PropertyID>, TokenStream<ComponentValue>&);
RefPtr<StyleValue const> parse_builtin_value(TokenStream<ComponentValue>&);
Optional<FlyString> parse_custom_ident(TokenStream<ComponentValue>&, ReadonlySpan<StringView> blacklist);
RefPtr<CustomIdentStyleValue const> parse_custom_ident_value(TokenStream<ComponentValue>&, ReadonlySpan<StringView> blacklist);
RefPtr<CustomIdentStyleValue const> parse_custom_ident_value(TokenStream<ComponentValue>&, ReadonlySpan<StringView> blacklist = {});
Optional<FlyString> parse_dashed_ident(TokenStream<ComponentValue>&);
RefPtr<CustomIdentStyleValue const> parse_dashed_ident_value(TokenStream<ComponentValue>&);
RefPtr<RandomValueSharingStyleValue const> parse_random_value_sharing(TokenStream<ComponentValue>&);

View file

@ -51,7 +51,7 @@ def is_numeric_type(type_name: str) -> bool:
@dataclass(frozen=True)
class Type:
name: str
custom_ident_blacklist: list[str] | None
custom_ident_blacklist: list[str]
numeric_type_accepted_range: NumericTypeRangeRestriction | None
def dump(self, indent: int) -> str:

View file

@ -149,7 +149,7 @@ class Tokenizer:
if not name:
raise SyntaxError("CSSGrammar::Tokenizer: Expected a type name")
custom_ident_blacklist = None
custom_ident_blacklist = []
if name == "custom-ident":
custom_ident_blacklist = self.consume_custom_ident_blacklist()

View file

@ -25,7 +25,7 @@ def generate_css_parser_expression_for_type_component_value(out: TextIO, cpp_nam
type_name = snake_casify(type.name)
additional_arguments = ""
if type.custom_ident_blacklist is not None:
if type.custom_ident_blacklist:
additional_arguments = ", ReadonlySpan<StringView> { "
if len(type.custom_ident_blacklist) > 0: