浏览代码

LibWeb: Early return from update_layout() if document is not active

Aliaksandr Kalenik 1 年之前
父节点
当前提交
c3e2a40b76
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Userland/Libraries/LibWeb/DOM/Document.cpp

+ 3 - 0
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())