Skip to content

Custom elements disconnected from a document should not be upgraded #419

Closed
@rniwa

Description

@rniwa

The current specification says, in section 6, that:

Each registry has an associated upgrade candidates map of all instances of unresolved elements, mapping a custom element type to a sorted element queue. It is is initially empty.

Whenever an unresolved element is created, it must be added to the respective sorted element queue in upgrade candidates map.

This results in the following code to keep accumulating the list of unresolved elements in the heap:

for (var i = 0; i < 1000000; i++)
    document.createElement('my-element');

I don't think this is an acceptable behavior. I don't think any custom element created prior to its definition getting loaded and not inserted into a document should be upgraded. In particular, any element that's not even referenced by JS and not in any node tree shouldn't be kept alive just for the sole purpose of being upgraded.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions