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

FrameMuse left a comment (whatwg/dom#736)

I was thinking about fallbacks for fragment boundaries, I think this way it should solve this problem.
_I don't think **actually** using comments as boundaries is the way for serialization._

```html
<template shadowRootMode="closed" as="group" name="myGroupName">
 <p>Text</p>
 <span>123</span>
</template>
```

This way we follow the rule proposed by @WebReflection (https://github.com/whatwg/dom/issues/736#issuecomment-2833322649), which is **hiding the internal structure**, while making a way for serialization since template is already there way some time, so it should be invisible for older versions of DOM. For newer versions that implement groups, it would actually create a group node.

**Alternative**

```html
<template shadowRootMode="closed" group="myGroupName">
 <p>Text</p>
 <span>123</span>
</template>
```
But my choice the one above as I also consider an element that would be inert (as a separate proposal), while either assignable with an element or attachable with `ShadowRoot`. And the first variant is more readable.




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

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

Received on Tuesday, 6 May 2025 06:53:57 UTC