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
parent bda4f8cbe8
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

@ -292,7 +292,7 @@ RefPtr<LinearGradientStyleValue const> Parser::parse_linear_gradient_function(To
tokens.discard_a_token(); // <angle>
auto angle_value = first_param.token().dimension_value();
auto unit_string = first_param.token().dimension_unit();
auto angle_type = Angle::unit_from_name(unit_string);
auto angle_type = string_to_angle_unit(unit_string);
if (!angle_type.has_value())
return nullptr;
@ -395,7 +395,7 @@ RefPtr<ConicGradientStyleValue const> Parser::parse_conic_gradient_function(Toke
if (!tokens.has_next_token())
return nullptr;
Angle from_angle(0, Angle::Type::Deg);
auto from_angle = Angle::make_degrees(0);
RefPtr<PositionStyleValue const> at_position;
Optional<InterpolationMethod> maybe_interpolation_method;
@ -426,7 +426,7 @@ RefPtr<ConicGradientStyleValue const> Parser::parse_conic_gradient_function(Toke
if (angle_token.is(Token::Type::Dimension)) {
auto angle = angle_token.token().dimension_value();
auto angle_unit = angle_token.token().dimension_unit();
auto angle_type = Angle::unit_from_name(angle_unit);
auto angle_type = string_to_angle_unit(angle_unit);
if (!angle_type.has_value())
return nullptr;