LibWeb/CSS: Use generated FooUnit types instead of Foo::Type

I've also renamed the `m_type` and `type()` members to be `m_unit` and
`unit()` instead, to match what they actually are.
This commit is contained in:
Sam Atkins 2025-09-02 13:48:49 +01:00
commit b3e32445d3
Notes: github-actions[bot] 2025-09-11 16:08:15 +00:00
29 changed files with 232 additions and 669 deletions

View file

@ -131,12 +131,12 @@ static Vector<ComponentValue> replace_an_attr_function(DOM::AbstractElement& ele
first_argument_tokens.discard_a_token(); // raw-string
syntax = RawString {};
} else if (syntax_ident == "%"sv
|| Angle::unit_from_name(syntax_ident).has_value()
|| Flex::unit_from_name(syntax_ident).has_value()
|| Frequency::unit_from_name(syntax_ident).has_value()
|| Length::unit_from_name(syntax_ident).has_value()
|| Resolution::unit_from_name(syntax_ident).has_value()
|| Time::unit_from_name(syntax_ident).has_value()) {
|| string_to_angle_unit(syntax_ident).has_value()
|| string_to_flex_unit(syntax_ident).has_value()
|| string_to_frequency_unit(syntax_ident).has_value()
|| string_to_length_unit(syntax_ident).has_value()
|| string_to_resolution_unit(syntax_ident).has_value()
|| string_to_time_unit(syntax_ident).has_value()) {
syntax = TypeSyntaxNode::create("number"_fly_string).release_nonnull<SyntaxNode>();
unit_name = first_argument_tokens.consume_a_token().token().ident();
} else {