diff --git a/Tests/LibWeb/Text/expected/navigation/remove-iframe-from-timeout-callback.txt b/Tests/LibWeb/Text/expected/navigation/remove-iframe-from-timeout-callback.txt
index 73fdda35bab..136d06384a4 100644
--- a/Tests/LibWeb/Text/expected/navigation/remove-iframe-from-timeout-callback.txt
+++ b/Tests/LibWeb/Text/expected/navigation/remove-iframe-from-timeout-callback.txt
@@ -1 +1 @@
-PASS: did not crash
+
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/navigation/remove-iframe-from-timeout-callback.html b/Tests/LibWeb/Text/input/navigation/remove-iframe-from-timeout-callback.html
index 24bb8176ee0..e6de8c2e329 100644
--- a/Tests/LibWeb/Text/input/navigation/remove-iframe-from-timeout-callback.html
+++ b/Tests/LibWeb/Text/input/navigation/remove-iframe-from-timeout-callback.html
@@ -1,16 +1,12 @@
-
+
+
+ PASS: did not crash
+
+
+
diff --git a/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp b/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp
index 73993fac8a9..6f2cf6732b2 100644
--- a/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp
+++ b/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp
@@ -572,7 +572,7 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_
// AD-HOC: Since currently populate_session_history_entry_document does not run in parallel
// we call spin_until to interrupt execution of this function and let document population
// to complete.
- main_thread_event_loop().spin_until([&] {
+ main_thread_event_loop().spin_processing_tasks_with_source_until(Task::Source::NavigationAndTraversal, [&] {
return !changing_navigable_continuations.is_empty() || completed_change_jobs == total_change_jobs;
});