فهرست منبع

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.
Andreas Kling 5 سال پیش
والد
کامیت
039fc0f2d1
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      Libraries/LibHTML/DOM/Document.cpp

+ 3 - 0
Libraries/LibHTML/DOM/Document.cpp

@@ -187,6 +187,9 @@ void Document::update_style()
 
 
 void Document::update_layout()
 void Document::update_layout()
 {
 {
+    if (!frame())
+        return;
+
     layout();
     layout();
     if (on_layout_updated)
     if (on_layout_updated)
         on_layout_updated();
         on_layout_updated();