From 039fc0f2d1be294990154262397b30ff5fc61b5c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 30 Nov 2019 11:57:41 +0100 Subject: [PATCH] LibHTML: Don't bother updating layout in frameless documents Before/after the document is attached to a frame, there's no point in doing any kind of layout, since we can't display the results anywhere. --- Libraries/LibHTML/DOM/Document.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/LibHTML/DOM/Document.cpp b/Libraries/LibHTML/DOM/Document.cpp index cdba807e77..5d1eaf19c5 100644 --- a/Libraries/LibHTML/DOM/Document.cpp +++ b/Libraries/LibHTML/DOM/Document.cpp @@ -187,6 +187,9 @@ void Document::update_style() void Document::update_layout() { + if (!frame()) + return; + layout(); if (on_layout_updated) on_layout_updated();