mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibWeb: Forbid reentrancy of style-layout-repaint in EventLoop::process
Fixes crashing on https://playbiolab.com/ in VERIFY(page.client().is_ready_to_paint()) caused by attempting to start the next repaint before the ongoing repaint is done. (cherry picked from commit f341af1d7265eee880355f10ef5d479c9ebceaf2)
This commit is contained in:
committed by
Nico Weber
parent
eb3219781d
commit
2a9b255b41
@@ -173,6 +173,17 @@ void EventLoop::process()
|
||||
// 8. Microtasks: Perform a microtask checkpoint.
|
||||
perform_a_microtask_checkpoint();
|
||||
|
||||
if (m_is_running_reflow_steps) {
|
||||
// NOTE: If we entered style-layout-repaint steps, then we need to wait for them to finish before doing next iteration.
|
||||
schedule();
|
||||
return;
|
||||
}
|
||||
|
||||
m_is_running_reflow_steps = true;
|
||||
ScopeGuard const guard = [this] {
|
||||
m_is_running_reflow_steps = false;
|
||||
};
|
||||
|
||||
// 9. Let hasARenderingOpportunity be false.
|
||||
[[maybe_unused]] bool has_a_rendering_opportunity = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user