1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibWeb: Wait until new document becomes active before running scripts

Fixes https://github.com/SerenityOS/serenity/issues/22485

With this change WebContent does not crash when `location.reload()` is
invoked but `Navigable::reload()` still not working because of spec
issue (https://github.com/whatwg/html/issues/9869) so we can't add a
test yet.
This commit is contained in:
Aliaksandr Kalenik 2023-12-30 15:45:10 +01:00 committed by Andreas Kling
parent 7e8d3e370f
commit 07928129dd
3 changed files with 13 additions and 1 deletions

View file

@ -3628,7 +3628,8 @@ void Document::update_for_history_step_application(JS::NonnullGCPtr<HTML::Sessio
// "process scroll behavior".
scroll_to_the_fragment();
// FIXME: 2. At this point scripts may run for the newly-created document document.
// 2. At this point scripts may run for the newly-created document document.
m_ready_to_run_scripts = true;
}
// 7. Otherwise, if documentsEntryChanged is false and doNotReactivate is false, then: