Implemented {Document,Element}.getElementsByTagNameNS

This commit is contained in:
Bruno de Oliveira Abinader 2014-02-27 13:18:03 -04:00
parent d22dbb53ca
commit e1499b610e
6 changed files with 26 additions and 6 deletions

View file

@ -9,6 +9,7 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::element::Element;
use dom::node::{Node, NodeHelpers};
use dom::window::Window;
use servo_util::namespace::Namespace;
use servo_util::str::DOMString;
#[deriving(Encodable)]
@ -50,6 +51,10 @@ impl HTMLCollection {
pub fn by_tag_name(window: &JS<Window>, root: &JS<Node>, tag_name: DOMString) -> JS<HTMLCollection> {
HTMLCollection::create(window, root, |elem| elem.get().tag_name == tag_name)
}
pub fn by_tag_name_ns(window: &JS<Window>, root: &JS<Node>, tag_name: DOMString, namespace: Namespace) -> JS<HTMLCollection> {
HTMLCollection::create(window, root, |elem| elem.get().namespace == namespace && elem.get().tag_name == tag_name)
}
}
impl HTMLCollection {