1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 11:57: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:
Andreas Kling 2022-03-23 14:54:21 +01:00
parent 632928a11e
commit 5118a4c1e7
6 changed files with 37 additions and 1 deletions

View file

@ -3590,7 +3590,8 @@ RefPtr<StyleValue> Parser::parse_font_value(Vector<StyleComponentValueRule> cons
RefPtr<StyleValue> font_size;
RefPtr<StyleValue> line_height;
RefPtr<StyleValue> font_families;
// FIXME: Implement font-stretch and font-variant.
RefPtr<StyleValue> font_variant;
// FIXME: Implement font-stretch.
// FIXME: Handle system fonts. (caption, icon, menu, message-box, small-caption, status-bar)
@ -3620,6 +3621,12 @@ RefPtr<StyleValue> Parser::parse_font_value(Vector<StyleComponentValueRule> cons
font_weight = value.release_nonnull();
continue;
}
if (property_accepts_value(PropertyID::FontVariant, *value)) {
if (font_variant)
return nullptr;
font_variant = value.release_nonnull();
continue;
}
if (property_accepts_value(PropertyID::FontSize, *value)) {
if (font_size)
return nullptr;