mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
LibWeb: Stop the style/layout update timers after updating style/layout
If we had a scheduled update of either of these kind, make sure to cancel it after performing an update. Otherwise we might do a redundant second update with the same results. This could happen if something schedules an async layout, and before it can happen, something requires a sync layout, which we do right away.
This commit is contained in:
parent
76ac1b2496
commit
865162b1c3
1 changed files with 2 additions and 0 deletions
|
@ -448,6 +448,7 @@ void Document::update_layout()
|
|||
}
|
||||
|
||||
m_needs_layout = false;
|
||||
m_layout_update_timer->stop();
|
||||
}
|
||||
|
||||
static void update_style_recursively(DOM::Node& node)
|
||||
|
@ -474,6 +475,7 @@ void Document::update_style()
|
|||
if (!needs_style_update() && !child_needs_style_update())
|
||||
return;
|
||||
update_style_recursively(*this);
|
||||
m_style_update_timer->stop();
|
||||
set_needs_layout();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue