Description
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.