summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM
diff options
context:
space:
mode:
authorKevin Meyer <kevinmeyer@me.com>2020-07-07 17:58:48 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-08 23:45:12 +0200
commit5b6920a18a570166aabe8e8eab702d099a09d552 (patch)
tree559c10241f8775c552495f5ecfccd9a06bd23ec9 /Libraries/LibWeb/DOM
parenta5b8cc2d0b7da1094976c94c906644b81eed8998 (diff)
downloadserenity-5b6920a18a570166aabe8e8eab702d099a09d552.zip
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.
Diffstat (limited to 'Libraries/LibWeb/DOM')
-rw-r--r--Libraries/LibWeb/DOM/Document.cpp3
1 files changed, 2 insertions, 1 deletions
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()