Re: [w3c/webcomponents] defined promise (#427)

> So, would it be document.whenDefined("x-mytag") returning a Promise

Just that one; to check multiple at once you use `Promise.all([document.whenDefined("x-mytag1"), document.whenDefined("x-mytag2")])`.

> I guess no, custom elements registry is currently global, which may not be quite right. (thinking about some closed shadow dom wanting to use some specific custom element but not expose that to outer world.) But that is a separate issue.

Hmm, that's a pretty interesting point (although I agree it's separate). People have talked about a registries API (#154 and elsewhere) but I hadn't considered if closed shadow roots give us new flexibility in that area.

I guess we still have the problem that motivated us to make the registry per-global instead of per-document in the first place, which is that there's only one `HTMLElement` constructor per global, so when authors do `new MyXTag()` which does `super()` calling `HTMLElement`, there's no way to know which registry to look up the element in.

---
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/427#issuecomment-207808259

Received on Saturday, 9 April 2016 15:42:10 UTC