This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15252 - Documentation error - TreeWalker.nextNode()
Summary: Documentation error - TreeWalker.nextNode()
Status: RESOLVED WORKSFORME
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 minor
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-17 01:28 UTC by Brandon Slade
Modified: 2011-12-17 11:01 UTC (History)
2 users (show)

See Also:


Attachments

Description Brandon Slade 2011-12-17 01:28:12 UTC
The current instructions for implementing this method can be found at http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-treewalker-nextnode.

Step 3.2 states that implementors should:

"If a node is following node and is not following root, set node to the first such node. Otherwise, run these substeps again."

Earlier in the steps, you were instructed to set node to currentNode. Since currentNode is always a descendant of root, this means that the first "if" statement is never true - the "otherwise" or "else" clause is executed immediately. After some thought, I believe that you meant the following instead:

"If a node is following node and is A DESCENDANT OF root, set node to the first such node. Otherwise, run these substeps again."

If this is what you meant, then please change it. If not, then please clear up exactly what you meant.

Also, there is a step 3.3, so consider changing the second sentence of 3.2 to "Otherwise, SKIP THE REMAINING SUBSTEPS AND THEN run them again." or "Otherwise, SKIP STEP 3 AND THEN run these substeps again."
Comment 1 Anne 2011-12-17 10:45:53 UTC
currentNode can be set to anything so it does not have to be a descendant.

I have made the clarification in the end.