mirror of
https://github.com/servo/servo.git
synced 2025-07-02 21:13:39 +01:00
Implemented {Document,Element}.getElementsByTagNameNS
This commit is contained in:
parent
d22dbb53ca
commit
e1499b610e
6 changed files with 26 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue