From 4708a65160f913e46efdf263d371723280a9c7d3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Feb 2022 14:12:23 +0100 Subject: [PATCH] LibWeb: Force a relayout when scrolling to anchor This ensures that the layout information is current, even when the scroll request happens immediately upon page load. This fixes an issue where reloading ACID2 wouldn't scroll down to the "#top" anchor point. --- Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 285aef278e..d21a107ff1 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -164,7 +164,7 @@ void BrowsingContext::scroll_to_anchor(String const& fragment) } } - active_document()->update_layout(); + active_document()->force_layout(); if (!element || !element->layout_node()) return;