aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlcollection.rs
diff options
context:
space:
mode:
authorEmanuel Rylke <ema-fox@web.de>2014-12-09 13:37:12 +0100
committerEmanuel Rylke <ema-fox@web.de>2014-12-09 13:41:14 +0100
commit8ed6ace682dff1fe866b411553de0b5494094d57 (patch)
treec88e0c90a76a2f554d4ee4d61f89ca7791a9af4d /components/script/dom/htmlcollection.rs
parent02955d39ccf7fcd8a76279e49c44715b62730c6d (diff)
downloadservo-8ed6ace682dff1fe866b411553de0b5494094d57.tar.gz
servo-8ed6ace682dff1fe866b411553de0b5494094d57.zip
Don't include the root element when calling Element#getElementsByTagName
Fixes #4249
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r--components/script/dom/htmlcollection.rs5
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 {