From f9e814826f4a2bc696201336c72b364bbc731db0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 18 Oct 2021 10:17:01 +0200 Subject: [PATCH] LibWeb: Only update layout if actually needed when scrolling to anchor --- Userland/Libraries/LibWeb/Page/BrowsingContext.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Page/BrowsingContext.cpp b/Userland/Libraries/LibWeb/Page/BrowsingContext.cpp index e435782cbd..a2c8933e3d 100644 --- a/Userland/Libraries/LibWeb/Page/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/Page/BrowsingContext.cpp @@ -158,8 +158,7 @@ void BrowsingContext::scroll_to_anchor(String const& fragment) } } - // FIXME: This is overly aggressive and should be something more like a "update_layout_if_needed()" - active_document()->force_layout(); + active_document()->update_layout(); if (!element || !element->layout_node()) return;