Don't include the root element when calling Element#getElementsByTagNameNS.

This commit is contained in:
Tomasz Kołodziejski 2014-12-12 10:07:41 -08:00
parent 758d79fff4
commit 5913ba983b
2 changed files with 4 additions and 8 deletions

View file

@ -119,7 +119,10 @@ impl HTMLCollection {
namespace_filter: Option<Namespace>
}
impl CollectionFilter for TagNameNSFilter {
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
}
let ns_match = match self.namespace_filter {
Some(ref namespace) => {
*elem.namespace() == *namespace