diff --git a/Libraries/LibWeb/DOM/Node.h b/Libraries/LibWeb/DOM/Node.h index f1e509e872c..92fa32e31f2 100644 --- a/Libraries/LibWeb/DOM/Node.h +++ b/Libraries/LibWeb/DOM/Node.h @@ -389,39 +389,6 @@ public: return index; } - Optional index_of_child(Node const& search_child) - { - VERIFY(search_child.parent() == this); - size_t index = 0; - auto* child = first_child(); - VERIFY(child); - - do { - if (child == &search_child) - return index; - index++; - } while (child && (child = child->next_sibling())); - return {}; - } - - template - Optional index_of_child(Node const& search_child) - { - VERIFY(search_child.parent() == this); - size_t index = 0; - auto* child = first_child(); - VERIFY(child); - - do { - if (!is(child)) - continue; - if (child == &search_child) - return index; - index++; - } while (child && (child = child->next_sibling())); - return {}; - } - bool is_ancestor_of(Node const&) const; bool is_inclusive_ancestor_of(Node const&) const; bool is_descendant_of(Node const&) const; diff --git a/Libraries/LibWeb/TreeNode.h b/Libraries/LibWeb/TreeNode.h index 7aaf0fc8403..498b7cedcde 100644 --- a/Libraries/LibWeb/TreeNode.h +++ b/Libraries/LibWeb/TreeNode.h @@ -41,24 +41,6 @@ public: return index; } - template - Optional index_of_child(T const& search_child) - { - VERIFY(search_child.parent() == this); - size_t index = 0; - auto* child = first_child(); - VERIFY(child); - - do { - if (!is(child)) - continue; - if (child == &search_child) - return index; - index++; - } while (child && (child = child->next_sibling())); - return {}; - } - bool is_ancestor_of(TreeNode const&) const; bool is_inclusive_ancestor_of(TreeNode const&) const;