Re: [whatwg/dom] How should `clonable` work in `cloneNode(false)`? (Issue #1249)

> Yeah, I don't mind either way, I'm just saying that that's not the built-in shadow tree behavior at least in Gecko.
> 
> Might be worth checking with @justinfagnani about the ergonomics of this for authors too.
> 
> E.g., code that does:
> 
> ```js
> connectedCallback() {
>   this.attachShadow({ ... });
> }
> ```
> 
> Or so will throw after cloning if we clone the shadow tree. Maybe fine? You kinda need to deal with that for moves inside the document.

Yes, you would never write code like that because moves are very common. You either call `attachShadow()` in the constructor or gate it and call it on the first connection only.

> So over-all I think given ^ I'm fine with cloning the shadow tree. But hopefully I'm not missing something.

I actually don't see how cloning the shadow tree is that useful at all in the general case. It's so common that the shadow root depends on non-clonable state, that the only components this would work for would have to be completely static.

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

Message ID: <whatwg/dom/issues/1249/1917977673@github.com>

Received on Tuesday, 30 January 2024 22:08:05 UTC