[w3c/webcomponents] Why does upgrade-an-element queue attribute, connected reactions before exiting early? (#523)

[Upgrade an element](https://html.spec.whatwg.org/multipage/scripting.html#upgrades) steps 1-2 queue reactions before checking whether the element is *custom*. AFAIK the step 3 "already custom" check is designed to prevent double upgrade in the case and element is reinserted while upgrade is pending.

Does this mean that there's no "double upgrade" but there is "double attribute changed dispatch" and "double connected?"

For what it is worth, "classic" custom elements fixed this using the queues themselves. It basically made a distinction between the state where upgrade has been queued, but not started; and upgrade had started. Blink implemented this by actually looking at a combination of the element state and whether the element queue's first reaction was upgrade, IIRC, and that seemed to work well.

/cc @domenic

---
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/523

Received on Thursday, 16 June 2016 08:21:18 UTC