summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-05-26 17:27:32 +0100
committerAndreas Kling <kling@serenityos.org>2023-05-27 16:12:25 +0200
commit4ecf0b7768a7f00b2e93058d1d551ba45187c6b9 (patch)
tree872d95e4df33847e6a0eb2134c4a645429bee21d /Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h
parent5f755d721e7151dcb7ba458452e5fec0893f36e4 (diff)
downloadserenity-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.h5
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; },