[Bug 20445] New: TreeWalker: Specified workflow stuck at root node

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20445

            Bug ID: 20445
           Summary: TreeWalker: Specified workflow stuck at root node
    Classification: Unclassified
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM
          Assignee: annevk@annevk.nl
          Reporter: krinklemail@gmail.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, www-dom@w3.org

While taking this API apart to implement in javascript (as exercise to learn
how to read specs) I noticed that methods like firstChild() and lastChild() are
stuck on the root node when implementing the specification.

For example:
> tw = document.createTreeWalker(document.body, NodeFilter.SHOW_ALL).firstChild()

In Chrome this returns document.body.firstChild.

However when following the spec:

| document.createTreeWalker( Node root, .. )
| * http://dom.spec.whatwg.org/#dom-document-createtreewalker
| > currentNode = root
| TreeWalker::firstChild()
| * http://dom.spec.whatwg.org/#concept-traverse-children
| > node = current = tw.currentNode
| - Filter
| - * http://dom.spec.whatwg.org/#concept-node-filter
| - > node's nodeType is accepted through NodeFilter.SHOW_ALL
| > tw.currentNode = node; // unaltered
| > return node;

Unless it was intended this way, I appears the spec is missing something in
either the Filter or the "Traverse children" subsets to get it off the root.


PS: I've looked at all three of these but since I noticed no significant
differences in this regard I've only linked to the last one above
* http://www.w3.org/TR/2012/WD-dom-20120105/#interface-treewalker
* http://www.w3.org/TR/dom/#interface-treewalker
* http://dom.spec.whatwg.org/#interface-treewalker

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Wednesday, 19 December 2012 08:24:55 UTC