From 3259b17a6abde8d4ded55fdd41818f5db64bc1a3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 9 Mar 2022 17:10:56 +0100 Subject: [PATCH] LibWeb: Add StyleValue::equals() override for PositionStyleValue --- Userland/Libraries/LibWeb/CSS/StyleValue.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index 180c5a4e2c..24d48ea986 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -1401,6 +1401,17 @@ public: virtual String to_string() const override; + virtual bool equals(StyleValue const& other) const override + { + if (type() != other.type()) + return false; + auto const& typed_other = static_cast(other); + return m_edge_x == typed_other.m_edge_x + && m_offset_x == typed_other.m_offset_x + && m_edge_y == typed_other.m_edge_y + && m_offset_y == typed_other.m_offset_y; + } + private: PositionStyleValue(PositionEdge edge_x, LengthPercentage const& offset_x, PositionEdge edge_y, LengthPercentage const& offset_y) : StyleValue(Type::Position)