Forráskód Böngészése

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.
Kevin Meyer 5 éve
szülő
commit
5b6920a18a
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      Libraries/LibWeb/DOM/Document.cpp

+ 2 - 1
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()