diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-05-26 17:27:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-27 16:12:25 +0200 |
commit | 4ecf0b7768a7f00b2e93058d1d551ba45187c6b9 (patch) | |
tree | 872d95e4df33847e6a0eb2134c4a645429bee21d /Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h | |
parent | 5f755d721e7151dcb7ba458452e5fec0893f36e4 (diff) | |
download | serenity-4ecf0b7768a7f00b2e93058d1d551ba45187c6b9.zip |
LibWeb: Remove StyleValue::has/to_number()
Only NumericStyleValue holds numbers.
Renamed `to_number()` to `number()` because it's just a getter now.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h index 59e6b86063..c435454f80 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h @@ -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; }, |