LibWeb: Remove unused BrowsingContext::document_family*()

This commit is contained in:
Andreas Kling 2023-09-19 20:36:36 +02:00
parent 38cb15ff49
commit 8e669c14c8
Notes: sideshowbarker 2024-07-18 00:54:03 +09:00
2 changed files with 0 additions and 32 deletions

View File

@ -747,35 +747,6 @@ BrowsingContext const* BrowsingContext::the_one_permitted_sandboxed_navigator()
return nullptr;
}
// https://html.spec.whatwg.org/multipage/browsers.html#document-family
Vector<JS::Handle<DOM::Document>> BrowsingContext::document_family() const
{
HashTable<DOM::Document*> documents;
for (auto& entry : m_session_history) {
if (!entry->document_state->document())
continue;
if (documents.set(const_cast<DOM::Document*>(entry->document_state->document().ptr())) == AK::HashSetResult::ReplacedExistingEntry)
continue;
for (auto& context : entry->document_state->document()->list_of_descendant_browsing_contexts()) {
for (auto& document : context->document_family()) {
documents.set(document.ptr());
}
}
}
Vector<JS::Handle<DOM::Document>> family;
for (auto* document : documents) {
family.append(*document);
}
return family;
}
// https://html.spec.whatwg.org/multipage/browsers.html#document-family
bool BrowsingContext::document_family_contains(DOM::Document const& document) const
{
return document_family().first_matching([&](auto& entry) { return entry.ptr() == &document; }).has_value();
}
void BrowsingContext::append_child(JS::NonnullGCPtr<BrowsingContext> child)
{
VERIFY(!child->m_parent);

View File

@ -191,9 +191,6 @@ public:
// https://html.spec.whatwg.org/multipage/origin.html#one-permitted-sandboxed-navigator
BrowsingContext const* the_one_permitted_sandboxed_navigator() const;
Vector<JS::Handle<DOM::Document>> document_family() const;
bool document_family_contains(DOM::Document const&) const;
bool has_been_discarded() const { return m_has_been_discarded; }
Optional<AK::URL> const& creator_url() const { return m_creator_url; }