Re: [w3c/webcomponents] Should custom elements be adoptable if so, how? (#512)

One thing to be aware of if you go with adopting callbacks or adopting steps is keeping the custom element state in sync with anything that *reads* or *sets* the state.

For example, [Upgrade an element](https://html.spec.whatwg.org/multipage/scripting.html#upgrades) step 3 reads the state and step 10 sets the state. Author script may run between the time that reaction is queued and when it is run, or between those two steps (step 6.)

My impression is that reading or setting the custom element state outside of a reaction quickly leads to unfortunate edge cases. So if you do that, there should be some compensating action on the element's queue, like voiding its queued reactions. (The queue is reentrant, by the way, so you may have to look hard at the upgrade reaction and decide if it needs to abort.)

---
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/512#issuecomment-226418227

Received on Thursday, 16 June 2016 08:16:24 UTC