1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibWeb: Use IdentifierStyleValue for CSS 'text-decoration-line'

Also 'text-decoration' is actually a shorthand, so treat it that way.
This commit is contained in:
Andreas Kling 2020-12-15 13:36:27 +01:00
parent dd9a77099f
commit 4d7ce81835
Notes: sideshowbarker 2024-07-19 00:48:59 +09:00
9 changed files with 96 additions and 3 deletions

View file

@ -409,4 +409,25 @@ CSS::Display StyleProperties::display() const
}
}
Optional<CSS::TextDecorationLine> StyleProperties::text_decoration_line() const
{
auto value = property(CSS::PropertyID::TextDecorationLine);
if (!value.has_value() || !value.value()->is_identifier())
return {};
switch (static_cast<const IdentifierStyleValue&>(*value.value()).id()) {
case CSS::ValueID::None:
return CSS::TextDecorationLine::None;
case CSS::ValueID::Underline:
return CSS::TextDecorationLine::Underline;
case CSS::ValueID::Overline:
return CSS::TextDecorationLine::Overline;
case CSS::ValueID::LineThrough:
return CSS::TextDecorationLine::LineThrough;
case CSS::ValueID::Blink:
return CSS::TextDecorationLine::Blink;
default:
return {};
}
}
}