LibWeb: Delete discard() in Document and BrowsingContext

Those are not used anymore after moving to navigables.
This commit is contained in:
Aliaksandr Kalenik 2023-09-04 16:47:13 +02:00 committed by Andreas Kling
parent 180c3e2fef
commit cd75b1de3d
Notes: sideshowbarker 2024-07-16 17:05:37 +09:00
4 changed files with 0 additions and 64 deletions

View File

@ -2674,40 +2674,6 @@ Vector<JS::Handle<HTML::BrowsingContext>> 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()
{

View File

@ -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();

View File

@ -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<BrowsingContext> child)
{
VERIFY(!child->m_parent);

View File

@ -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<AK::URL> const& creator_url() const { return m_creator_url; }