Skip to content

importNode should allow null customElementRegistry #1463

@sorvell

Description

@sorvell

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions