1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-28 17:02: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

@ -395,8 +395,8 @@ int StyleValue::to_font_weight() const
return Gfx::FontWeight::Regular;
}
}
if (has_integer()) {
return to_integer();
if (is_numeric() && as_numeric().has_integer()) {
return as_numeric().integer();
}
if (is_calculated()) {
auto maybe_weight = const_cast<CalculatedStyleValue&>(as_calculated()).resolve_integer();