Implement TreeWalker

This commit is contained in:
Chris Paris 2014-08-20 13:46:21 -10:00
parent 5e5f77a354
commit 92638a6fe6
10 changed files with 603 additions and 71 deletions

View file

@ -45,6 +45,12 @@ interface Document : Node {
Event createEvent(DOMString interface_);
Range createRange();
// NodeFilter.SHOW_ALL = 0xFFFFFFFF
// [NewObject]
// NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
[NewObject]
TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
};
/* http://www.whatwg.org/specs/web-apps/current-work/#the-document-object */

View file

@ -8,16 +8,27 @@
*/
interface TreeWalker {
// [SameObject] readonly attribute Node root;
// readonly attribute unsigned long whatToShow;
// readonly attribute NodeFilter? filter;
// attribute Node currentNode;
[SameObject,Constant]
readonly attribute Node root;
[Constant]
readonly attribute unsigned long whatToShow;
[Constant]
readonly attribute NodeFilter? filter;
[Pure, SetterThrows]
attribute Node currentNode;
// Node? parentNode();
// Node? firstChild();
// Node? lastChild();
// Node? previousSibling();
// Node? nextSibling();
// Node? previousNode();
// Node? nextNode();
[Throws]
Node? parentNode();
[Throws]
Node? firstChild();
[Throws]
Node? lastChild();
[Throws]
Node? previousSibling();
[Throws]
Node? nextSibling();
[Throws]
Node? previousNode();
[Throws]
Node? nextNode();
};