mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:27:35 +00:00
LibWeb: Add a specialized BorderRadiusStyleValue::equals()
This allows fast comparison of two BorderRadiusStyleValues.
This commit is contained in:
parent
ae7bbd93b8
commit
c55909f175
1 changed files with 10 additions and 0 deletions
|
@ -822,6 +822,16 @@ public:
|
|||
return String::formatted("{} / {}", m_horizontal_radius.to_string(), m_vertical_radius.to_string());
|
||||
}
|
||||
|
||||
virtual bool equals(StyleValue const& other) const override
|
||||
{
|
||||
if (type() != other.type())
|
||||
return false;
|
||||
auto& other_value = static_cast<BorderRadiusStyleValue const&>(other);
|
||||
return m_is_elliptical == other_value.m_is_elliptical
|
||||
&& m_horizontal_radius == other_value.m_horizontal_radius
|
||||
&& m_vertical_radius == other_value.m_vertical_radius;
|
||||
}
|
||||
|
||||
private:
|
||||
BorderRadiusStyleValue(Length const& horizontal_radius, Length const& vertical_radius)
|
||||
: StyleValue(Type::BorderRadius)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue