1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:27:42 +00:00

LibWeb: Use IdentifierStyleValue for CSS 'list-style-type'

This commit is contained in:
Andreas Kling 2020-12-15 16:50:39 +01:00
parent c630ae517e
commit 9c76c4f0cf
7 changed files with 52 additions and 1 deletions

View file

@ -453,4 +453,26 @@ Optional<CSS::TextTransform> StyleProperties::text_transform() const
}
}
Optional<CSS::ListStyleType> StyleProperties::list_style_type() const
{
auto value = property(CSS::PropertyID::ListStyleType);
if (!value.has_value())
return {};
switch (value.value()->to_identifier()) {
case CSS::ValueID::None:
return CSS::ListStyleType::None;
case CSS::ValueID::Disc:
return CSS::ListStyleType::Disc;
case CSS::ValueID::Circle:
return CSS::ListStyleType::Circle;
case CSS::ValueID::Square:
return CSS::ListStyleType::Square;
case CSS::ValueID::Decimal:
return CSS::ListStyleType::Decimal;
default:
return {};
}
}
}