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

@ -1729,7 +1729,7 @@ LengthOrCalculated Parser::parse_as_sizes_attribute(DOM::Element const& element,
// AD-HOC: If element has no sizes attribute, this algorithm always logs a parse error and then returns 100vw.
// The attribute is optional, so avoid spamming the debug log with false positives by just returning early.
if (!element.has_attribute(HTML::AttributeNames::sizes))
return Length(100, Length::Type::Vw);
return Length(100, LengthUnit::Vw);
// 1. Let unparsed sizes list be the result of parsing a comma-separated list of component values
// from the value of element's sizes attribute (or the empty string, if the attribute is absent).
@ -1828,7 +1828,7 @@ LengthOrCalculated Parser::parse_as_sizes_attribute(DOM::Element const& element,
}
// 4. Return 100vw.
return Length(100, Length::Type::Vw);
return Length(100, LengthUnit::Vw);
}
bool Parser::has_ignored_vendor_prefix(StringView string)