LibWeb: Handle non-numeric font-weight values in keyframes

Previously, using `font-weight` with a keyword or `calc()` value inside
a keyframe rule would cause a crash.
This commit is contained in:
Tim Ledbetter 2025-06-25 05:55:10 +01:00 committed by Jelle Raaijmakers
parent e69d9fb331
commit 48f56cad08
Notes: github-actions[bot] 2025-06-25 07:03:08 +00:00
3 changed files with 42 additions and 1 deletions

View file

@ -386,7 +386,7 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
// 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.font_size());
computed_values.set_font_weight(round_to<int>(computed_style.property(CSS::PropertyID::FontWeight).as_number().number()));
computed_values.set_font_weight(computed_style.property(CSS::PropertyID::FontWeight).to_font_weight());
computed_values.set_font_kerning(computed_style.font_kerning());
computed_values.set_line_height(computed_style.line_height());