mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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.
This commit is contained in:
parent
41b065dec9
commit
cfcec5e18e
Notes:
sideshowbarker
2024-07-16 22:16:50 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/cfcec5e18e Pull-request: https://github.com/SerenityOS/serenity/pull/22367 Reviewed-by: https://github.com/ADKaster ✅
@ -3578,6 +3578,11 @@ void Document::update_for_history_step_application(JS::NonnullGCPtr<HTML::Sessio
|
|||||||
// 6. If documentIsNew is true, then:
|
// 6. If documentIsNew is true, then:
|
||||||
if (document_is_new) {
|
if (document_is_new) {
|
||||||
// FIXME: 1. Try to scroll to the fragment for document.
|
// FIXME: 1. Try to scroll to the fragment for document.
|
||||||
|
// FIXME: According to the spec we should only scroll here if document has no parser or parsing has stopped.
|
||||||
|
// It should be ok to remove this after we implement navigation events and scrolling will happen in
|
||||||
|
// "process scroll behavior".
|
||||||
|
scroll_to_the_fragment();
|
||||||
|
|
||||||
// FIXME: 2. At this point scripts may run for the newly-created document document.
|
// FIXME: 2. At this point scripts may run for the newly-created document document.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user