From c3e2a40b76572bdffe42e6665a60ace62a2a8800 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 31 Aug 2023 12:24:31 +0200 Subject: [PATCH] LibWeb: Early return from update_layout() if document is not active --- Userland/Libraries/LibWeb/DOM/Document.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index e757da3f59..80fdc676d4 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -948,6 +948,9 @@ static void propagate_overflow_to_viewport(Element& root_element, Layout::Viewpo void Document::update_layout() { + if (!is_active()) + return; + // NOTE: If our parent document needs a relayout, we must do that *first*. // This is necessary as the parent layout may cause our viewport to change. if (browsing_context() && browsing_context()->container())