mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 13:19:47 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user