From 5b6920a18a570166aabe8e8eab702d099a09d552 Mon Sep 17 00:00:00 2001 From: Kevin Meyer Date: Tue, 7 Jul 2020 17:58:48 +0200 Subject: [PATCH] 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. --- Libraries/LibWeb/DOM/Document.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index fb4bcd838f..a6efb1e533 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -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()