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

rniwa left a comment (whatwg/dom#736)

> > introducing a new element like  which can appear anywhere in HTML is a non-starter.
> 
> my concern too ... and I start wondering if what we're all after is actually a formal way to standardize comments boundaries or simply extend, or introduce, a new kind of comment that automatically knows it's starting and ending point and is able to move around all nodes in between in one go via insertBefore or moveBefore, effectively representing a persistent fragment proposing minimal parsing or behavior changes and just a comment extend.

Yeah, that could be a sensible approach as well.

> In one of my _hydration_ exploration/solutions that special node was `<!--[3]--><br><br><br><!--[/]-->` where the `[3]` represents the list of direct next siblings to handle on move/remove operations and it would change if a specific node in it is appended or removed, reflecting the new "_range_" ... this doesn't seem too complicated and, if standardized, it would help tooling to never break that contract or drop those nodes.

Yeah, something like that could work. I guess the primary question is _why_ we want to bake such a mechanism into the web platform itself instead of implementing it in user-land.

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

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

Received on Tuesday, 25 March 2025 09:41:16 UTC