mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Implemented {Document,Element}.getElementsByTagNameNS
This commit is contained in:
parent
d22dbb53ca
commit
e1499b610e
6 changed files with 26 additions and 6 deletions
|
@ -35,7 +35,7 @@ use dom::window::Window;
|
|||
use html::hubbub_html_parser::build_element_from_tag;
|
||||
use hubbub::hubbub::{QuirksMode, NoQuirks, LimitedQuirks, FullQuirks};
|
||||
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
|
||||
use servo_util::namespace::Null;
|
||||
use servo_util::namespace::{Namespace, Null};
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
use extra::url::{Url, from_str};
|
||||
|
@ -216,6 +216,15 @@ impl Document {
|
|||
HTMLCollection::by_tag_name(&self.window, &NodeCast::from(abstract_self), tag_name)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens
|
||||
pub fn GetElementsByTagNameNS(&self, abstract_self: &JS<Document>, maybe_ns: Option<DOMString>, tag_name: DOMString) -> JS<HTMLCollection> {
|
||||
let namespace = match maybe_ns {
|
||||
Some(namespace) => Namespace::from_str(namespace),
|
||||
None => Null
|
||||
};
|
||||
HTMLCollection::by_tag_name_ns(&self.window, &NodeCast::from(abstract_self), tag_name, namespace)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid
|
||||
pub fn GetElementById(&self, id: DOMString) -> Option<JS<Element>> {
|
||||
// TODO: "in tree order, within the context object's tree"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue