diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index f462e6a0c3..303ac4fd4d 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -2674,40 +2674,6 @@ Vector> Document::list_of_descendant_browsing_ return list; } -// https://html.spec.whatwg.org/multipage/window-object.html#discard-a-document -void Document::discard() -{ - // 1. Set document's salvageable state to false. - m_salvageable = false; - - // FIXME: 2. Run any unloading document cleanup steps for document that are defined by this specification and other applicable specifications. - - // 3. Abort document. - abort(); - - // 4. Remove any tasks associated with document in any task source, without running those tasks. - HTML::main_thread_event_loop().task_queue().remove_tasks_matching([this](auto& task) { - return task.document() == this; - }); - - // 5. Discard all the child browsing contexts of document. - if (browsing_context()) { - browsing_context()->for_each_child([](HTML::BrowsingContext& child_browsing_context) { - child_browsing_context.discard(); - }); - } - - // FIXME: 6. For each session history entry entry whose document is equal to document, set entry's document to null. - - // 7. Set document's browsing context to null. - tear_down_layout_tree(); - m_browsing_context = nullptr; - - // FIXME: 8. Remove document from the owner set of each WorkerGlobalScope object whose set contains document. - - // FIXME: 9. For each workletGlobalScope in document's worklet global scopes, terminate workletGlobalScope. -} - // https://html.spec.whatwg.org/multipage/document-lifecycle.html#destroy-a-document void Document::destroy() { diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 83c77ac0b1..14e216d56f 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -478,9 +478,6 @@ public: void destroy(); - // https://html.spec.whatwg.org/multipage/window-object.html#discard-a-document - void discard(); - // https://html.spec.whatwg.org/multipage/browsing-the-web.html#abort-a-document void abort(); diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 0ebe359f26..bb77a9b04a 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -855,31 +855,6 @@ void BrowsingContext::set_system_visibility_state(VisibilityState visibility_sta }); } -// https://html.spec.whatwg.org/multipage/window-object.html#a-browsing-context-is-discarded -void BrowsingContext::discard() -{ - m_has_been_discarded = true; - - // 1. Discard all Document objects for all the entries in browsingContext's session history. - for (auto& entry : m_session_history) { - if (entry->document_state->document()) - entry->document_state->document()->discard(); - } - - // AD-HOC: - // FIXME: This should be in the session history! - if (auto* document = active_document()) - document->discard(); - - // 2. If browsingContext is a top-level browsing context, then remove browsingContext. - if (is_top_level()) - remove(); - - // AD-HOC: - if (parent()) - parent()->remove_child(*this); -} - void BrowsingContext::append_child(JS::NonnullGCPtr child) { VERIFY(!child->m_parent); diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h index cdd2605da5..3d743b15ea 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -208,8 +208,6 @@ public: VisibilityState system_visibility_state() const; void set_system_visibility_state(VisibilityState); - // https://html.spec.whatwg.org/multipage/window-object.html#a-browsing-context-is-discarded - void discard(); bool has_been_discarded() const { return m_has_been_discarded; } Optional const& creator_url() const { return m_creator_url; }