LibWeb: Stop pretending text-decoration-thickness is a LengthPercentage

It has two keywords: auto and from-font. from-font isn't handled
properly yet, but at least we have a FIXME for it now. :^)
This commit is contained in:
Sam Atkins 2025-08-27 15:12:17 +01:00
commit 381d3bf4e0
Notes: github-actions[bot] 2025-09-04 12:34:14 +00:00
5 changed files with 50 additions and 10 deletions

View file

@ -1192,6 +1192,28 @@ TextDecorationStyle ComputedProperties::text_decoration_style() const
return keyword_to_text_decoration_style(value.to_keyword()).release_value();
}
TextDecorationThickness ComputedProperties::text_decoration_thickness() const
{
auto const& value = property(PropertyID::TextDecorationThickness);
if (value.is_keyword()) {
switch (value.to_keyword()) {
case Keyword::Auto:
return { TextDecorationThickness::Auto {} };
case Keyword::FromFont:
return { TextDecorationThickness::FromFont {} };
default:
VERIFY_NOT_REACHED();
}
}
if (value.is_length())
return TextDecorationThickness { LengthPercentage { value.as_length().length() } };
if (value.is_percentage())
return TextDecorationThickness { LengthPercentage { value.as_percentage().percentage() } };
if (value.is_calculated())
return TextDecorationThickness { LengthPercentage { value.as_calculated() } };
VERIFY_NOT_REACHED();
}
TextTransform ComputedProperties::text_transform() const
{
auto const& value = property(PropertyID::TextTransform);