فهرست منبع

LibWeb: Don't force relayout on scheduled layout update

If something else has already caused a layout, there's no need to force
a new relayout when the layout timer fires.

This avoids a lot of redundant work on many pages. :^)
Andreas Kling 2 سال پیش
والد
کامیت
222a1b8b95
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Userland/Libraries/LibWeb/DOM/Document.cpp

+ 1 - 1
Userland/Libraries/LibWeb/DOM/Document.cpp

@@ -313,7 +313,7 @@ Document::Document(JS::Realm& realm, const AK::URL& url)
     });
 
     m_layout_update_timer = Platform::Timer::create_single_shot(0, [this] {
-        force_layout();
+        update_layout();
     });
 }