Bug 15252 - Documentation error - TreeWalker.nextNode()
Summary: Documentation error - TreeWalker.nextNode()
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
Depends on:
Reported: 2011-12-17 01:28 UTC by Brandon Slade
Modified: 2011-12-17 11:01 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
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.