From 889b903e401b91ccda85eb3e190369897a4c1dab Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 7 Feb 2024 08:30:15 -0700 Subject: [PATCH] LibWeb: Call the_end() on Documents from window.open("about:blank") --- Userland/Libraries/LibWeb/HTML/Window.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index 5f258a33428..50f4c1394ce 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -395,9 +396,11 @@ WebIDL::ExceptionOr> Window::open_impl(StringView url, St } // 6. If urlRecord matches about:blank, then perform the URL and history update steps given targetNavigable's active document and urlRecord. - // FIXME: If we only perform the URL and history update steps here, we never fire the load event for the new window/tab. - // This breaks WPT. See #23067 - if (false && url_matches_about_blank(url_record)) { + if (url_matches_about_blank(url_record)) { + // AD-HOC: Mark the initial about:blank for the new window as load complete + // FIXME: We do this other places too when creating a new about:blank document. Perhaps it's worth a spec issue? + HTML::HTMLParser::the_end(*target_navigable->active_document()); + perform_url_and_history_update_steps(*target_navigable->active_document(), url_record); }