浏览代码

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] {
     m_layout_update_timer = Platform::Timer::create_single_shot(0, [this] {
-        force_layout();
+        update_layout();
     });
     });
 }
 }