1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibWeb: Remove StyleValue::has/to_integer()

Only NumericStyleValue holds integers.

I'm not sure our current distinction between NumericStyleValue holding
an integer or non-integer is useful given it always returns a float.
:thonk:
This commit is contained in:
Sam Atkins 2023-05-26 17:43:20 +01:00 committed by Andreas Kling
parent 4ecf0b7768
commit 5cbf6eb930
5 changed files with 9 additions and 11 deletions

View file

@ -295,7 +295,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
// That's why it has to be set before everything else.
m_font = computed_style.computed_font();
computed_values.set_font_size(computed_style.property(CSS::PropertyID::FontSize)->to_length().to_px(*this).value());
computed_values.set_font_weight(computed_style.property(CSS::PropertyID::FontWeight)->to_integer());
computed_values.set_font_weight(computed_style.property(CSS::PropertyID::FontWeight)->as_numeric().integer());
m_line_height = computed_style.line_height(*this);
computed_values.set_vertical_align(computed_style.vertical_align());