mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00:00
LibWeb: Parse CSS "font-variant" as part of "font"
This allows us to parse CSS "font" values that contain e.g "small-caps" or "normal", as used on Acid3.
This commit is contained in:
parent
632928a11e
commit
5118a4c1e7
6 changed files with 37 additions and 1 deletions
|
@ -999,4 +999,20 @@ Variant<CSS::VerticalAlign, CSS::LengthPercentage> StyleProperties::vertical_ali
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
Optional<CSS::FontVariant> StyleProperties::font_variant() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::FontVariant);
|
||||
if (!value.has_value())
|
||||
return {};
|
||||
|
||||
switch (value.value()->to_identifier()) {
|
||||
case CSS::ValueID::Normal:
|
||||
return CSS::FontVariant::Normal;
|
||||
case CSS::ValueID::SmallCaps:
|
||||
return CSS::FontVariant::SmallCaps;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue