diff options
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r-- | components/script/dom/htmlcollection.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index c07af986135..3ac4d491513 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -85,7 +85,10 @@ impl HTMLCollection { ascii_lower_tag: Atom, } impl CollectionFilter for TagNameFilter { - fn filter(&self, elem: JSRef<Element>, _root: JSRef<Node>) -> bool { + fn filter(&self, elem: JSRef<Element>, root: JSRef<Node>) -> bool { + if NodeCast::from_ref(elem) == root { + return false + } if elem.html_element_in_html_document() { *elem.local_name() == self.ascii_lower_tag } else { |