From cfcec5e18e9535e94926d38123d0b088776b0b5b Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 20 Dec 2023 14:01:44 +0100 Subject: [PATCH] LibWeb: Scroll to the top after navigating to a new document This change fixes a bug with running tests where, if one of the previous tests changes the scroll position, all subsequent tests that rely on the scroll position will fail. This is because the headless browser never resets the viewport offset. --- Userland/Libraries/LibWeb/DOM/Document.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 827770b83a..9a9095f6db 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -3578,6 +3578,11 @@ void Document::update_for_history_step_application(JS::NonnullGCPtr