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

This reverts commit 609a72f7c7.
This commit is contained in:
Andreas Kling 2024-03-30 08:28:16 +01:00
commit f90489acd6
Notes: sideshowbarker 2024-07-17 07:11:12 +09:00
3 changed files with 13 additions and 17 deletions

View file

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

View file

@ -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;
});