[whatwg/dom] "The nextNode() method, when invoked, must run t..." (#787)

https://dom.spec.whatwg.org/commit-snapshots/57512fac17cf2f1c4c85be4aec178c8086ee5ee4/#interface-treewalker


> The nextNode\(\) method, when invoked, must run these steps:​
> 
> 1. Let node be the context object’s current\.
> 2. Let result be FILTER\_ACCEPT\.
> 3. While true:​
>     1. While result is not FILTER\_REJECT and node has a child:​
>         1. Set node to its first child\.
>         2.Set result to the result of filtering node within the context object\.
>         3. If result is FILTER\_ACCEPT, then set the context object’s current to node and return node\.
>     2. Let sibling be null\.
>     3. Let temporary be node\.
>     4. While temporary is non\-null:​
>         1. If temporary is the context object’s root, then return null\.
>         2. Set sibling to temporary’s next sibling\.
>         3. If sibling is non\-null, then break\.
>         4. Set temporary to temporary’s parent\.
>     5. If sibling is null, break
>     6. Set node to sibling
>     7. Set result to the result of filtering node within the context object\.
>     8. If result is FILTER\_ACCEPT, then set the context object’s current to node and return node\.

In the algorithm are missing the steps 5 and 6, without them, it loops infinite

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/787

Received on Sunday, 6 October 2019 20:30:09 UTC