1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibWeb: Delete unused document_tree_child_browsing_context_count()

The function is no longer needed with navigables.
This commit is contained in:
Aliaksandr Kalenik 2023-09-03 23:04:35 +02:00 committed by Andreas Kling
parent 605d24ef7d
commit 6665f0db43
Notes: sideshowbarker 2024-07-16 22:51:10 +09:00
4 changed files with 0 additions and 30 deletions

View file

@ -881,20 +881,6 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex
return { chosen.ptr(), window_type };
}
// https://html.spec.whatwg.org/multipage/browsers.html#document-tree-child-browsing-context
size_t BrowsingContext::document_tree_child_browsing_context_count() const
{
size_t count = 0;
// A browsing context child is a document-tree child browsing context of parent if child is a child browsing context and child's container is in a document tree.
for_each_child([this, &count](BrowsingContext const& child) {
if (child.is_child_of(*this) && child.container()->in_a_document_tree())
++count;
});
return count;
}
// https://html.spec.whatwg.org/multipage/browsers.html#child-browsing-context
bool BrowsingContext::is_child_of(BrowsingContext const& parent) const
{

View file

@ -169,8 +169,6 @@ public:
ChosenBrowsingContext choose_a_browsing_context(StringView name, TokenizedFeature::NoOpener no_opener, ActivateTab = ActivateTab::Yes);
size_t document_tree_child_browsing_context_count() const;
bool is_child_of(BrowsingContext const&) const;
HTML::NavigableContainer* container() { return m_container; }

View file

@ -1394,16 +1394,4 @@ JS::NonnullGCPtr<CustomElementRegistry> Window::custom_elements()
return JS::NonnullGCPtr { *m_custom_element_registry };
}
// https://html.spec.whatwg.org/multipage/window-object.html#number-of-document-tree-child-browsing-contexts
size_t Window::document_tree_child_browsing_context_count() const
{
// 1. If W's browsing context is null, then return 0.
auto* this_browsing_context = associated_document().browsing_context();
if (!this_browsing_context)
return 0;
// 2. Return the number of document-tree child browsing contexts of W's browsing context.
return this_browsing_context->document_tree_child_browsing_context_count();
}
}

View file

@ -85,8 +85,6 @@ public:
JS::GCPtr<Navigable> navigable() const;
size_t document_tree_child_browsing_context_count() const;
ImportMap const& import_map() const { return m_import_map; }
bool import_maps_allowed() const { return m_import_maps_allowed; }