[whatwg/dom] importNode should allow null customElementRegistry (Issue #1463)

sorvell created an issue (whatwg/dom#1463)

### What problem are you trying to solve?

Currently importNode's [ImportNodeOptions](https://dom.spec.whatwg.org/#dom-importnodeoptions-customelementregistry) customElementRegistry cannot be `null`.

Because elements with `null` registries receive the document registry upon adoption, this means that it's not possible to call `document.importNode`, for example, on a template's content fragment and retain a `null` custom element registry.

While this is an unusual use case, it can come up when creating elements while the intended registry is not yet available.

### What solutions exist today?

It's possible to workaround this by creating elements imperatively, but this is cumbersome.

### How would you solve it?

Allow `null` to be set for importNode's customElementRegistry option and honor it as the fallback registry.

### Anything else?

Migrated, see https://github.com/whatwg/html/issues/12396#issuecomment-4299236280

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

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

Received on Friday, 24 April 2026 15:16:22 UTC