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

> As for this issue, it seems reasonable that the upgrade candidates map holds weak references to the elements. That is, if they are only referenced from there, they should just be collected and not instantiated.

I did initially thought about that but the problem is that it can expose GC behavior. For example, WebKit currently implements stack-scanning conservative generational GC.  It would mean that if the stack happens to contain a value that matches the node's memory address or if the major GC (non-eden collection) doesn't happen in time before the end of nano-task occurs, we may end up instantiating custom elements that would otherwise be dead in other browsers.

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

Received on Monday, 7 March 2016 08:52:15 UTC