LibWeb/HTML: Create a temporary execution context to abort navigation

Stops this WPT test from crashing:
navigation-api/ordering-and-transition/transition-to.html

...it now times out instead, so more work is needed before importing.
This commit is contained in:
Sam Atkins 2025-12-04 15:52:28 +00:00
parent d2029b1814
commit 43bd5342c5
Notes: github-actions[bot] 2025-12-05 09:21:30 +00:00

View file

@ -37,6 +37,7 @@
#include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/HTML/SandboxingFlagSet.h>
#include <LibWeb/HTML/Scripting/ClassicScript.h>
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
#include <LibWeb/HTML/SessionHistoryEntry.h>
#include <LibWeb/HTML/StructuredSerialize.h>
#include <LibWeb/HTML/TraversableNavigable.h>
@ -2569,6 +2570,8 @@ void Navigable::inform_the_navigation_api_about_aborting_navigation()
return;
queue_global_task(Task::Source::NavigationAndTraversal, *active_window(), GC::create_function(heap(), [this] {
HTML::TemporaryExecutionContext execution_context { active_window()->realm() };
// 2. Let navigation be navigable's active window's navigation API.
VERIFY(active_window());
auto navigation = active_window()->navigation();