瀏覽代碼

Revert "LibWeb: Fix endless spinning in apply_the_history_step()"

This reverts commit 609a72f7c738b69bf79c1595c438d6fa25a314a7.
Andreas Kling 1 年之前
父節點
當前提交
f90489acd6

+ 1 - 1
Tests/LibWeb/Text/expected/navigation/remove-iframe-from-timeout-callback.txt

@@ -1 +1 @@
-PASS: did not crash 
+  

+ 11 - 15
Tests/LibWeb/Text/input/navigation/remove-iframe-from-timeout-callback.html

@@ -1,16 +1,12 @@
-<script src="../include.js"></script><div id="foo"><iframe></iframe><script>
-    setTimeout(function () {
-        foo.remove();
-        window.done = true;
-    }, 0);
-</script></div><iframe></iframe><script>
-    asyncTest(function (done) {
-        let internalId;
-        internalId = setInterval(function () {
-            if (window.done) {
-                clearInterval(internalId);
-                done();
-            }
+<script src="../include.js"></script>
+<div id="foo">
+    <iframe></iframe>
+    <script>
+        setTimeout(function () {
+            foo.remove();
+            // Pass (didn't crash)
+            internals.signalTextTestIsDone();
         }, 0);
-    });
-</script>PASS: did not crash
+    </script>
+</div>
+<iframe></iframe>

+ 1 - 1
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;
         });