LibWeb: Don't call did_layout in non-main frame documents

Fixes https://github.com/SerenityOS/serenity/issues/2649

Loading a page with iframes could lead to a scenario, where the iframe
document finished layout prior to the main frame beeing laid out
initially. This caused a crash/assertion of the browser.
This commit is contained in:
Kevin Meyer 2020-07-07 17:58:48 +02:00 committed by Andreas Kling
parent a5b8cc2d0b
commit 5b6920a18a
Notes: sideshowbarker 2024-07-19 05:00:56 +09:00

View file

@ -246,7 +246,8 @@ void Document::layout()
m_layout_root->layout();
m_layout_root->set_needs_display();
frame()->page().client().page_did_layout();
if (frame()->is_main_frame())
frame()->page().client().page_did_layout();
}
void Document::update_style()