Re: [whatwg/dom] Adopting children of an intentional null shadow root goes wrong (Issue #1429)

annevk left a comment (whatwg/dom#1429)

It's tricky as what you adopt could have a mix of null and scoped registry nodes. If you look at the root (tree scope is an implementation-specific term) it doesn't work for `<a-b customelementregistry>`. And if you look at the parent children of scoped registry nodes will remain null. The latter seems acceptable though as that's a novel case you have to go somewhat out of your way to construct.

So that would mean the logic we want is this:

- If _inclusiveDescendant_'s parent is null or _inclusiveDescendant_'s parent is a DocumentFragent but not a ShadowRoot node, then do the current logic.
- Otherwise, if _inclusiveDescendant_ is an element, _inclusiveDescendant_'s custom element registry is null or _inclusiveDescendant_'s custom element registry's is scoped is false, and _inclusiveDescendant_'s parent is non-null, then set _inclusiveDescendant_'s custom element registry to _inclusiveDescendant_'s parent's custom element registry's effective global custom element registry.

(This would need some further changes as "effective global custom element registry" is only defined for documents right now and "custom element registry" is not generic across elements and shadow roots, but hopefully the idea is clear.)

cc @rniwa 

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

Message ID: <whatwg/dom/issues/1429/3584489143@github.com>

Received on Thursday, 27 November 2025 07:17:58 UTC