Implement Document.createNodeIterator and rebase patch

This commit is contained in:
Jinwoo Song 2015-04-29 18:08:37 +09:00
parent 0e4c792dc5
commit 4e8005cd5b
3 changed files with 14 additions and 9 deletions

View file

@ -58,6 +58,7 @@ use dom::keyboardevent::KeyboardEvent;
use dom::messageevent::MessageEvent;
use dom::node::{self, Node, NodeHelpers, NodeTypeId, CloneChildrenFlag, NodeDamage, window_from_node};
use dom::nodelist::NodeList;
use dom::nodeiterator::NodeIterator;
use dom::text::Text;
use dom::processinginstruction::ProcessingInstruction;
use dom::range::Range;
@ -1363,6 +1364,12 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
Range::new_with_doc(self)
}
// https://dom.spec.whatwg.org/#dom-document-createnodeiterator
fn CreateNodeIterator(self, root: JSRef<Node>, whatToShow: u32, filter: Option<NodeFilter>)
-> Temporary<NodeIterator> {
NodeIterator::new(self, root, whatToShow, filter)
}
// https://dom.spec.whatwg.org/#dom-document-createtreewalker
fn CreateTreeWalker(self, root: JSRef<Node>, whatToShow: u32, filter: Option<NodeFilter>)
-> Temporary<TreeWalker> {