1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

LibWeb: Remove StyleValue::has/to_number()

Only NumericStyleValue holds numbers.

Renamed `to_number()` to `number()` because it's just a getter now.
This commit is contained in:
Sam Atkins 2023-05-26 17:27:32 +01:00 committed by Andreas Kling
parent 5f755d721e
commit 4ecf0b7768
4 changed files with 14 additions and 15 deletions

View file

@ -25,11 +25,10 @@ public:
return adopt_nonnull_ref_or_enomem(new (nothrow) NumericStyleValue(value));
}
virtual bool has_length() const override { return to_number() == 0; }
virtual bool has_length() const override { return number() == 0; }
virtual Length to_length() const override { return Length::make_px(0); }
virtual bool has_number() const override { return true; }
virtual float to_number() const override
float number() const
{
return m_value.visit(
[](float value) { return value; },