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

WebReflection left a comment (whatwg/dom#736)

> 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.

a few reasons:

  * if standard, tools will learn to understand that minified HTML, as example, should never remove those comments
  * we don't have hooks to know if nodes in between have been moved elsewhere or removed ... it would require some convoluted MutationObserver dance that might not reflect the amount of nodes at the moment it's being processed
  * appending a "*range-comment*" requires patching DOM primitives
  * moving a "*range-comment*" requires patching DOM primitives
  * if everyone patches DOM primitives it'll be a mess out there ... conflicting libraries, broken patches and whatnot

probably there are other valid reasons too.

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

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

Received on Tuesday, 25 March 2025 09:49:44 UTC