1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibWeb: Add StyleValue::equals() override for PositionStyleValue

This commit is contained in:
Andreas Kling 2022-03-09 17:10:56 +01:00
parent 43d5257619
commit 3259b17a6a

View file

@ -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)