- From: bptato <notifications@github.com>
- Date: Mon, 29 Jun 2026 11:45:02 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/907/4835850804@github.com>
bptato left a comment (whatwg/dom#907) To my understanding, there are three cases to consider: 1. if toBeRemovedNode is not an inclusive ancestor of referenceNode, then referenceNode is unaffected by the removal, so bail. e.g. * root * toBeRemovedNode * referenceNode 2. if toBeRemovedNode is an inclusive ancestor of root, then the NodeIterator will be completely detached from the subtree anyway, so bail. e.g. * toBeRemovedNode * root * referenceNode 3. if toBeRemovedNode is a descendant of root, but also an inclusive ancestor of referenceNode, *then* set referenceNode to something that isn't an inclusive descendant of toBeRemovedNode. e.g. * root * toBeRemovedNode * referenceNode * someOtherNode (will become referenceNode) As it stands, the spec does not fully cover case 2; I believe it should read: > 1. If toBeRemovedNode is not an inclusive ancestor of nodeIterator’s reference, or toBeRemovedNode is **an inclusive ancestor of** nodeIterator’s root, then return. (At least my naive implementation passes the aforementioned WPT tests with the above change. Looking at the Gecko link, it apparently invokes the removing steps from "ContentWillBeRemoved", so maybe case 2 is implicitly fulfilled there.) -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/907#issuecomment-4835850804 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/907/4835850804@github.com>
Received on Monday, 29 June 2026 18:45:06 UTC