summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2023-04-13 15:51:09 +0100
committerLinus Groh <mail@linusgroh.de>2023-04-13 18:24:18 +0200
commit2125464b7641c03b1fac3a8f20a6085b4c4eae48 (patch)
tree1d044b83b0d11494cafaaaabb89bdc05a259d653 /Userland/Libraries
parentf80c05424edff2b1df041df614df7e4f2151751e (diff)
downloadserenity-2125464b7641c03b1fac3a8f20a6085b4c4eae48.zip
LibWeb: Don't match the root node of HTMLCollection
Every user of HTMLCollection does not expect the root node to be a potential match, so let's avoid it by using non-inclusive sub-tree traversal. This avoids matching the element that getElementsByTagName was called on for example, which is required by Ruffle: https://github.com/ruffle-rs/ruffle/blob/da689b7687d6bb23f37251e902ccddabdfcc5f48/web/packages/core/src/ruffle-object.ts#L321-L329
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp
index 098abb4924..106adb80b9 100644
--- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp
+++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp
@@ -44,7 +44,7 @@ void HTMLCollection::visit_edges(Cell::Visitor& visitor)
JS::MarkedVector<Element*> HTMLCollection::collect_matching_elements() const
{
JS::MarkedVector<Element*> elements(m_root->heap());
- m_root->for_each_in_inclusive_subtree_of_type<Element>([&](auto& element) {
+ m_root->for_each_in_subtree_of_type<Element>([&](auto& element) {
if (m_filter(element))
elements.append(const_cast<Element*>(&element));
return IterationDecision::Continue;