Przeglądaj źródła

LibWeb: Make update_style() a no-op if there's no browsing context

Style is needed to lay out and paint a document, but we can't do either
those when the document isn't attached to a browsing context.
Andreas Kling 3 lat temu
rodzic
commit
c772134e25
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      Userland/Libraries/LibWeb/DOM/Document.cpp

+ 2 - 0
Userland/Libraries/LibWeb/DOM/Document.cpp

@@ -445,6 +445,8 @@ static void update_style_recursively(DOM::Node& node)
 
 void Document::update_style()
 {
+    if (!browsing_context())
+        return;
     update_style_recursively(*this);
     update_layout();
 }