Re: [WICG/webcomponents] Scoped Custom Element Registries (#716)

> I believe it would be better that if someone does something fishy, like moving a scoped custom element from a ShadowRoot to the main Document or another ShadowRoot, an error would be thrown (f.e. `DOMException: Scoped custom element does not belong to this Document or ShadowRoot`). I do not think that allowing weird patterns is ideal in any language or system in general, if it can be avoided.

Even if people want to move elements in and out of a shadow root, it could be an option to require using `.adoptNode`, which would require the element also be defined in the target ShadowRoot/Document (otherwise throw an error for not being defined in scope), this would change the name as needed and also call `adoptedCallback` on the element which would be a useful signal that it has changed scopes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/716#issuecomment-916434451

Received on Thursday, 9 September 2021 21:04:05 UTC