From 7ce4cbfe1d6a3c5cf6dcc6d1059a0a9f8beb4a82 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 1 Jun 2023 17:27:18 +0100 Subject: LibWeb: Convert NumberStyleValue from float to double We have double precision in the parser, and currently use doubles for most of layout, so we might as well keep that extra precision inside NumberStyleValue too. --- Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h index 08464947fb..c04c4ff8fc 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h @@ -15,25 +15,25 @@ namespace Web::CSS { class NumberStyleValue : public StyleValueWithDefaultOperators { public: - static ErrorOr> create(float value) + static ErrorOr> create(double value) { return adopt_nonnull_ref_or_enomem(new (nothrow) NumberStyleValue(value)); } - float number() const { return m_value; } + double number() const { return m_value; } virtual ErrorOr to_string() const override; bool properties_equal(NumberStyleValue const& other) const { return m_value == other.m_value; } private: - explicit NumberStyleValue(float value) + explicit NumberStyleValue(double value) : StyleValueWithDefaultOperators(Type::Number) , m_value(value) { } - float m_value { 0 }; + double m_value { 0 }; }; } -- cgit v1.2.3