mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
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:
parent
ae40c7ed95
commit
381d3bf4e0
Notes:
github-actions[bot]
2025-09-04 12:34:14 +00:00
Author: https://github.com/AtkinsSJ
Commit: 381d3bf4e0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6043
5 changed files with 50 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue