From 58a0ca41a728b44135dab98931d2b96ea2f171f7 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 18 Oct 2021 15:26:38 +0100 Subject: [PATCH] LibWeb: Use east const in StyleValue.{h,cpp} --- Userland/Libraries/LibWeb/CSS/StyleValue.cpp | 2 +- Userland/Libraries/LibWeb/CSS/StyleValue.h | 30 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index 2bd5f70a1d..d305d5577f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -367,7 +367,7 @@ Color IdentifierStyleValue::to_color(Layout::NodeWithStyle const& node) const } } -ImageStyleValue::ImageStyleValue(const AK::URL& url, DOM::Document* document) +ImageStyleValue::ImageStyleValue(AK::URL const& url, DOM::Document* document) : StyleValue(Type::Image) , m_url(url) , m_document(document) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index fe1f26e8b7..a8e8e16c98 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -340,10 +340,10 @@ public: virtual float to_number() const { return {}; } virtual String to_string() const = 0; - bool operator==(const StyleValue& other) const { return equals(other); } - bool operator!=(const StyleValue& other) const { return !(*this == other); } + bool operator==(StyleValue const& other) const { return equals(other); } + bool operator!=(StyleValue const& other) const { return !(*this == other); } - virtual bool equals(const StyleValue& other) const + virtual bool equals(StyleValue const& other) const { if (type() != other.type()) return false; @@ -679,7 +679,7 @@ public: virtual bool has_color() const override { return true; } virtual Color to_color(Layout::NodeWithStyle const&) const override { return m_color; } - virtual bool equals(const StyleValue& other) const override + virtual bool equals(StyleValue const& other) const override { if (type() != other.type()) return false; @@ -733,7 +733,7 @@ private: // FIXME: Allow for fallback class CustomStyleValue : public StyleValue { public: - static NonnullRefPtr create(const String& custom_property_name) + static NonnullRefPtr create(String const& custom_property_name) { return adopt_ref(*new CustomStyleValue(custom_property_name)); } @@ -741,7 +741,7 @@ public: String to_string() const override { return m_custom_property_name; } private: - explicit CustomStyleValue(const String& custom_property_name) + explicit CustomStyleValue(String const& custom_property_name) : StyleValue(Type::CustomProperty) , m_custom_property_name(custom_property_name) { @@ -868,7 +868,7 @@ public: virtual Color to_color(Layout::NodeWithStyle const& node) const override; virtual String to_string() const override; - virtual bool equals(const StyleValue& other) const override + virtual bool equals(StyleValue const& other) const override { if (type() != other.type()) return false; @@ -889,7 +889,7 @@ class ImageStyleValue final : public StyleValue , public ImageResourceClient { public: - static NonnullRefPtr create(const AK::URL& url, DOM::Document* document) { return adopt_ref(*new ImageStyleValue(url, document)); } + static NonnullRefPtr create(AK::URL const& url, DOM::Document* document) { return adopt_ref(*new ImageStyleValue(url, document)); } virtual ~ImageStyleValue() override { } String to_string() const override { return String::formatted("Image({})", m_url.to_string()); } @@ -897,7 +897,7 @@ public: const Gfx::Bitmap* bitmap() const { return m_bitmap; } private: - ImageStyleValue(const AK::URL&, DOM::Document*); + ImageStyleValue(AK::URL const&, DOM::Document*); // ^ResourceClient virtual void resource_did_load() override; @@ -945,7 +945,7 @@ private: class LengthStyleValue : public StyleValue { public: - static NonnullRefPtr create(const Length& length) + static NonnullRefPtr create(Length const& length) { return adopt_ref(*new LengthStyleValue(length)); } @@ -958,15 +958,15 @@ public: virtual String to_string() const override { return m_length.to_string(); } virtual Length to_length() const override { return m_length; } - virtual bool equals(const StyleValue& other) const override + virtual bool equals(StyleValue const& other) const override { if (type() != other.type()) return false; - return m_length == static_cast(other).m_length; + return m_length == static_cast(other).m_length; } private: - explicit LengthStyleValue(const Length& length) + explicit LengthStyleValue(Length const& length) : StyleValue(Type::Length) , m_length(length) { @@ -1082,7 +1082,7 @@ private: class StringStyleValue : public StyleValue { public: - static NonnullRefPtr create(const String& string) + static NonnullRefPtr create(String const& string) { return adopt_ref(*new StringStyleValue(string)); } @@ -1091,7 +1091,7 @@ public: String to_string() const override { return m_string; } private: - explicit StringStyleValue(const String& string) + explicit StringStyleValue(String const& string) : StyleValue(Type::String) , m_string(string) {