Re: [w3c/webcomponents] Custom Element - untrackable upgrade (#671)

So the problem here is that there's no way to know when an element gets inserted into the document and upgraded after the matching custom element had already been defined?

So the order of events that lead to a problematic situation is:
1. A custom element E is defined in some document D
2. An upgrade candidate C is created for E in a template, a different document, etc...
3. E is inserted into D
4. E is upgraded

And you'd like to know when 4 happens? Is it sufficient to know when a particular element gets upgraded? Or do you want to observe all elements that get upgraded to some custom element?

That is, is it sufficient to, let's say have a variant of `whenDefined(element)` which takes an element and resolves a promise when the element gets upgraded, or you want some kind of observer which gets involved whenever some element gets upgraded to a custom element of a given name. e.g. `setCustomElementUpgradeCallback('my-element', (element) => /*do stuff with element*/)`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/671#issuecomment-333006549

Received on Friday, 29 September 2017 01:28:55 UTC