Fix getElementsByTagName[NS] support to match the spec.

This commit is contained in:
James Graham 2014-07-27 22:44:13 +01:00
parent 70e70fd1d9
commit 0b802ab018
5 changed files with 65 additions and 22 deletions

View file

@ -389,6 +389,7 @@ pub trait NodeHelpers {
fn owner_doc(&self) -> Temporary<Document>;
fn set_owner_doc(&self, document: &JSRef<Document>);
fn is_in_html_doc(&self) -> bool;
fn wait_until_safe_to_modify_dom(&self);
@ -672,6 +673,10 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
self.owner_doc.assign(Some(document.clone()));
}
fn is_in_html_doc(&self) -> bool {
self.owner_doc().root().is_html_document
}
fn children(&self) -> AbstractNodeChildrenIterator {
AbstractNodeChildrenIterator {
current_node: self.first_child.get().map(|node| (*node.root()).clone()),