Просмотр исходного кода

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 лет назад
Родитель
Сommit
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();
     });
 }