From f90489acd6b36b8aa48dda266e1fc72770b2c009 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 30 Mar 2024 08:28:16 +0100 Subject: [PATCH] Revert "LibWeb: Fix endless spinning in apply_the_history_step()" This reverts commit 609a72f7c738b69bf79c1595c438d6fa25a314a7. --- .../remove-iframe-from-timeout-callback.txt | 2 +- .../remove-iframe-from-timeout-callback.html | 26 ++++++++----------- .../LibWeb/HTML/TraversableNavigable.cpp | 2 +- 3 files changed, 13 insertions(+), 17 deletions(-) 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; });