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:
parent
dd9a77099f
commit
4d7ce81835
Notes:
sideshowbarker
2024-07-19 00:48:59 +09:00
Author: https://github.com/awesomekling
Commit: 4d7ce81835
9 changed files with 96 additions and 3 deletions
|
@ -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 {};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue