diff options
author | Andreas Kling <kling@serenityos.org> | 2022-03-09 17:10:56 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-09 18:14:24 +0100 |
commit | 3259b17a6abde8d4ded55fdd41818f5db64bc1a3 (patch) | |
tree | 75bd615be6e34b6d6b7142b3af2da5e4201aa64a /Userland/Libraries/LibWeb | |
parent | 43d52576190cc4f27aff9c51a66d625a95d047ec (diff) | |
download | serenity-3259b17a6abde8d4ded55fdd41818f5db64bc1a3.zip |
LibWeb: Add StyleValue::equals() override for PositionStyleValue
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValue.h | 11 |
1 files changed, 11 insertions, 0 deletions
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<PositionStyleValue const&>(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) |