What problem are you trying to solve?
Currently importNode's ImportNodeOptions 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 whatwg/html#12396 (comment)
What problem are you trying to solve?
Currently importNode's ImportNodeOptions customElementRegistry cannot be
null.Because elements with
nullregistries receive the document registry upon adoption, this means that it's not possible to calldocument.importNode, for example, on a template's content fragment and retain anullcustom 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
nullto be set for importNode's customElementRegistry option and honor it as the fallback registry.Anything else?
Migrated, see whatwg/html#12396 (comment)