1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibWeb: Make Element::recompute_style() really compare properties

It's not enough to compare StyleProperties pointers to see if something
changed, we have to do a deep compare.
This commit is contained in:
Andreas Kling 2022-03-13 00:00:30 +01:00
parent 1223c88e68
commit 201afb50c7

View file

@ -271,13 +271,12 @@ void Element::recompute_style()
{
set_needs_style_update(false);
VERIFY(parent());
auto old_specified_css_values = m_specified_css_values;
auto new_specified_css_values = document().style_computer().compute_style(*this);
if (old_specified_css_values == new_specified_css_values)
if (m_specified_css_values && *m_specified_css_values == *new_specified_css_values)
return;
m_specified_css_values = new_specified_css_values;
m_specified_css_values = move(new_specified_css_values);
document().invalidate_layout();
}