From 6f31a19c5f0b7bcae89037ceb65c474b20482ca2 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 13 Sep 2024 07:41:07 -0400 Subject: [PATCH] LibWeb: Spin the HTML event loop when awaiting a navigable fetch Spinning the HTML event loop allows microtasks to run (i.e. Promise completions). --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 93c96553123..c6b09fa6a9f 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -855,7 +855,7 @@ static WebIDL::ExceptionOr create_navigation } // 7. Wait until either response is non-null, or navigable's ongoing navigation changes to no longer equal navigationId. - Platform::EventLoopPlugin::the().spin_until([&]() { + HTML::main_thread_event_loop().spin_until([&]() { if (response_holder->response() != nullptr) return true;