Re: [whatwg/dom] Proposal: a DocumentFragment whose nodes do not get removed once inserted (#736)

WebReflection left a comment (whatwg/dom#736)

>  Making it inherit from DocumentFragment cleverly avoids any runtime cost being introduced.

you're breaking an opened door here *and* that's the reason I've implemented it as such, but since people are having hard time thinking outside the *fragment* limitations I've thought about proposing a "*what if*", because my polyfill would not change a single LOC as my "*what if*" is purely theoretically and practically I am doing exactly the same I've suggested as alternative so ... if the counter-implementation is worse, not being it a node, let's forget about it, works for me the way it is already, I just wanted to make clear why expecting `children[0].parentNode` to be anything in particular with this new primitive makes very little sense, imho (and yet I'd be curious to see/learn/understand why that is a concern to start with, beside the status-quo expectation around something *new*, hence different).

> does it violate any implementation constraint that a Node could be in more than one list of childNodes?

FWIWI, the list is *virtual* when a *GroupNode* is live, it's a *Range* and a Node can be part of multiple ranges, if that adds/answers anything ... if the *GroupNode* should be a *fragment* having it with new expectations is better than having a *fragment* that cannot provide `childNodes` ... now that surely would break expectations.

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

Message ID: <whatwg/dom/issues/736/2810585419@github.com>

Received on Wednesday, 16 April 2025 19:43:35 UTC