[webcomponents] Custom elements disconnected from a document should not be upgraded (#419)

The current specification says, in [section 6](https://w3c.github.io/webcomponents/spec/custom/#registering-custom-elements), that:

> When an unresolved element is created, and if its element interface was not defined by HTML or other applicable specifications, the unresolved element's element interface must be HTMLElement.

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

```js
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 a custom element created prior to its definition getting loaded and not inserted into a document should be upgraded.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/419

Received on Monday, 7 March 2016 02:53:43 UTC