mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
Notes:
sideshowbarker
2024-07-17 17:30:59 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/201afb50c7
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user