diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
index d9d4f45869..c46b435a4b 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
@@ -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
{
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h
index e09220e4f1..8646a1b006 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h
@@ -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; }
diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp
index 780fdc5375..832e42c7f9 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Window.cpp
@@ -1394,16 +1394,4 @@ JS::NonnullGCPtr 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();
-}
-
}
diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h
index 2b8f47dfe1..0a1be8341e 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.h
+++ b/Userland/Libraries/LibWeb/HTML/Window.h
@@ -85,8 +85,6 @@ public:
JS::GCPtr 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; }