Re: [whatwg/dom] Allow elements with a null customElementRegistry without declaratively and without Shadow DOM (Issue #1413)

sorvell left a comment (whatwg/dom#1413)

Thanks for the quick reply. The concern with addressing this now-ish is that if we change the way null is handled there's compatibility risk.

The reason to handle different null cases is to preserve what happens when adopting an element from a template, e.g. `document.body.append(template.content.cloneNode(true))`. These elements start with a null registry but need to gain the adopting document's registry.

To be clear, the idea here is that a null registry would not be mutated on append.

Perhaps we can extend the [adoption rule](https://github.com/whatwg/dom/issues/1390) to explicitly include `null` so that when an element is adopted, its `customElementRegistry` is set to the adopting document's `customElementRegistry` when:
1. its custom element registry matches the source document's registry, null inclusive, e.g. `element.customElementRegistry === element.ownerDocument.customElementRegistry`.
2. and its [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) is **_not_** `failed` or `custom` or `precustomized`


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

Message ID: <whatwg/dom/issues/1413/3390522713@github.com>

Received on Friday, 10 October 2025 14:38:37 UTC