diff --git a/Libraries/LibWeb/HTML/Navigable.cpp b/Libraries/LibWeb/HTML/Navigable.cpp index d9b46a22984..eb24be0c060 100644 --- a/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Libraries/LibWeb/HTML/Navigable.cpp @@ -2345,6 +2345,19 @@ bool Navigable::has_a_rendering_opportunity() const return browsing_context->page().client().is_ready_to_paint(); } +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#inform-the-navigation-api-about-child-navigable-destruction +void Navigable::inform_the_navigation_api_about_child_navigable_destruction() +{ + // 1. Inform the navigation API about aborting navigation in navigable. + inform_the_navigation_api_about_aborting_navigation(); + + // FIXME: 2. Let navigation be navigable's active window's navigation API. + + // FIXME: 3. Let traversalAPIMethodTrackers be a clone of navigation's upcoming traverse API method trackers. + + // FIXME: 4. For each apiMethodTracker of traversalAPIMethodTrackers: reject the finished promise for apiMethodTracker with a new "AbortError" DOMException created in navigation's relevant realm. +} + // https://html.spec.whatwg.org/multipage/nav-history-apis.html#inform-the-navigation-api-about-aborting-navigation void Navigable::inform_the_navigation_api_about_aborting_navigation() { diff --git a/Libraries/LibWeb/HTML/Navigable.h b/Libraries/LibWeb/HTML/Navigable.h index 5f3e74570a4..0ed73282546 100644 --- a/Libraries/LibWeb/HTML/Navigable.h +++ b/Libraries/LibWeb/HTML/Navigable.h @@ -186,6 +186,8 @@ public: bool has_session_history_entry_and_ready_for_navigation() const { return m_has_session_history_entry_and_ready_for_navigation; } void set_has_session_history_entry_and_ready_for_navigation(); + void inform_the_navigation_api_about_child_navigable_destruction(); + bool has_pending_navigations() const { return !m_pending_navigations.is_empty(); } template diff --git a/Libraries/LibWeb/HTML/NavigableContainer.cpp b/Libraries/LibWeb/HTML/NavigableContainer.cpp index 2d09af66275..ae6eefdaab8 100644 --- a/Libraries/LibWeb/HTML/NavigableContainer.cpp +++ b/Libraries/LibWeb/HTML/NavigableContainer.cpp @@ -285,7 +285,8 @@ void NavigableContainer::destroy_the_child_navigable() return; navigable->set_has_been_destroyed(); - // FIXME: 4. Inform the navigation API about child navigable destruction given navigable. + // 4. Inform the navigation API about child navigable destruction given navigable. + navigable->inform_the_navigation_api_about_child_navigable_destruction(); // 5. Destroy a document and its descendants given navigable's active document. navigable->active_document()->destroy_a_document_and_its_descendants(GC::create_function(heap(), [this, navigable] {