Skip to content

Commit

Permalink
Fix TreeWalker's nextNode()
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Apr 9, 2018
1 parent ef16158 commit 826d66b
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -9287,10 +9287,23 @@ steps:
{{TreeWalker/currentNode}} attribute to <var>node</var> and return <var>node</var>.
</ol>

<li><p>If there is a <a>node</a> that is <a>following</a> <var>node</var> and is not
<a>following</a> <a for=traversal>root</a>, then set <var>node</var> to the first such
<a>node</a>. Otherwise, return null.
<!-- Implemented as iterating over parent/nextSibling -->
<li><p>Let <var>sibling</var> be null.

<li><p>Let <var>temporary</var> be <var>node</var>.

<li>
<p>While <var>temporary</var> is non-null:

<ol>
<li><p>If <var>temporary</var> is the <a>context object</a>'s <a for=traversal>root</a>, then
return null.

<li><p>Set <var>sibling</var> to <var>temporary</var>'s <a for=tree>next sibling</a>.

<li><p>If <var>sibling</var> is non-null, then <a for=iteration>break</a>.

This comment has been minimized.

Copy link
@johan

johan Jul 27, 2018

This whole while loop is a no-op unless we grow this then clause to something like then set <var>node</var> to <var>temporary</var> and <a for=iteration>break</a>.

This comment has been minimized.

Copy link
@annevk

annevk Jul 31, 2018

Author Member

Could you please file that as an issue with additional explanation?


<li><p>Set <var>temporary</var> to <var>temporary</var>'s <a for=tree>parent</a>.
</ol>

<li><p>Set <var>result</var> to the result of <a for=Node>filtering</a> <var>node</var>.

Expand Down

0 comments on commit 826d66b

Please sign in to comment.