LibWeb: Spin the HTML event loop when awaiting a navigable fetch

Spinning the HTML event loop allows microtasks to run (i.e. Promise
completions).
This commit is contained in:
Timothy Flynn 2024-09-13 07:41:07 -04:00 committed by Tim Flynn
parent bdb67d2bcb
commit 6f31a19c5f
Notes: github-actions[bot] 2024-09-13 14:12:27 +00:00

View file

@ -855,7 +855,7 @@ static WebIDL::ExceptionOr<Navigable::NavigationParamsVariant> create_navigation
} }
// 7. Wait until either response is non-null, or navigable's ongoing navigation changes to no longer equal navigationId. // 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) if (response_holder->response() != nullptr)
return true; return true;