From 222a1b8b958251f05f7c8d4cdefc99f0511a5059 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 7 May 2023 18:43:50 +0200 Subject: [PATCH] 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. :^) --- Userland/Libraries/LibWeb/DOM/Document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index a2c780a57f..2119601d37 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/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(); }); }