[whatwg/dom] NodeIterator pre-removing steps seem incorrect (#496)

https://dom.spec.whatwg.org/commit-snapshots/cd3bcaeea40b4b9355ae7be3a5799813faa492fc/#interface-nodeiterator

Consider the scenario at https://jsbin.com/zugoyutice/edit?html,console,output , in particular the removeChild() call.

toBeRemovedNode = referenceNode = root = the span

1. toBeRemovedNode is an inclusive ancestor of referenceNode, so step 1 passes
2. pointerBeforeReferenceNode = true (since it starts that way)
  1. next = null; there is nothing that is not an inclusive descendant of toBeRemovedNode but is an inclusive descendant of root
  2. Do nothing
  3. **Set pointerBeforeReferenceNode to false**
3. **Set referenceNode to the body**

However the test shows that pointerBeforeReferenceNode and referenceNode do not change.

This appears to have regressed in https://github.com/whatwg/dom/commit/259775f14d55b21de16cbb0a3c625741fd54aa0b, as jsdom has an implementation based on the older removing-steps-based algorithm, and updating broke a bunch of our (to-be-upstreamed) tests.

-- 
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/496

Received on Sunday, 20 August 2017 06:53:40 UTC