diff options
author | Emanuel Rylke <ema-fox@web.de> | 2014-12-09 13:37:12 +0100 |
---|---|---|
committer | Emanuel Rylke <ema-fox@web.de> | 2014-12-09 13:41:14 +0100 |
commit | 8ed6ace682dff1fe866b411553de0b5494094d57 (patch) | |
tree | c88e0c90a76a2f554d4ee4d61f89ca7791a9af4d /components/script/dom/htmlcollection.rs | |
parent | 02955d39ccf7fcd8a76279e49c44715b62730c6d (diff) | |
download | servo-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.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 { |