LibWeb: Handle percentage font-size values

This commit is contained in:
Gingeh 2025-06-24 16:03:27 +10:00 committed by Sam Atkins
commit b85a8a23a7
Notes: github-actions[bot] 2025-06-24 11:44:06 +00:00
5 changed files with 77 additions and 2 deletions

View file

@ -385,7 +385,7 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
// m_font is used by Length::to_px() when resolving sizes against this layout node.
// That's why it has to be set before everything else.
computed_values.set_font_list(computed_style.computed_font_list());
computed_values.set_font_size(computed_style.property(CSS::PropertyID::FontSize).as_length().length().to_px(*this));
computed_values.set_font_size(computed_style.font_size());
computed_values.set_font_weight(round_to<int>(computed_style.property(CSS::PropertyID::FontWeight).as_number().number()));
computed_values.set_font_kerning(computed_style.font_kerning());
computed_values.set_line_height(computed_style.line_height());