1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +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

@ -363,6 +363,9 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
computed_values.set_font_size(specified_style.property(CSS::PropertyID::FontSize).value()->to_length().to_px(*this));
computed_values.set_font_weight(specified_style.property(CSS::PropertyID::FontWeight).value()->to_integer());
if (auto maybe_font_variant = specified_style.font_variant(); maybe_font_variant.has_value())
computed_values.set_font_variant(maybe_font_variant.release_value());
// FIXME: BorderXRadius properties are now BorderRadiusStyleValues, so make use of that.
auto border_bottom_left_radius = specified_style.property(CSS::PropertyID::BorderBottomLeftRadius);
if (border_bottom_left_radius.has_value() && border_bottom_left_radius.value()->is_border_radius())