mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
LibWeb: Remove unused BrowsingContext::document_family*()
This commit is contained in:
parent
38cb15ff49
commit
8e669c14c8
Notes:
sideshowbarker
2024-07-18 00:54:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8e669c14c8 Pull-request: https://github.com/SerenityOS/serenity/pull/21167 Reviewed-by: https://github.com/AtkinsSJ ✅
@ -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);
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user