This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The rationale is that the createdCallback is like a constructor and should run to completion before callbacks start firing. However the callbacks should still be queued (not dropped) while the createdCallback is running, because that is past the point where the prototype has been updated. For example: proto.createdCallback = function() { console.log('created start'); this.remove(); this.setAttribute('foo', 'bar'); console.log('created end'); }; ... (other callbacks which log) ... should log created start created end entered left attribute changed Maybe the relationship between enqueuing a callback in a callback queue, and moving the callback queue to the top-of-processing stack element queue needs to change. Maybe the spec should model this with an explicit flag ( ("created-callback-ran"). If the flag is not set when enqueuing a callback (other than the created callback and the special-case first entered callback), then the callback queue should not be moved to the top-of-processing-stack. (Of course no callbacks are queued until the created callback has started running, as usual.)
Thank you for taking this on. You are appreciated for working on rationalizing some of these feature requests! Seems better to achieve by changing the nature of the queue relationships and not with a flag, but that's just $0.02 worth.
Ok. I've been trying to think of a solution that doesn't involve special treatment of the created callback, but haven't come up with one.
FWIW Blink implements it this way now, we can get feedback from developers. Anecdotally, the developer of Chrome apps' <webview> thought this was an improvement.
Also (from bug 22991): > - With the exception of the created callback and the magic entered callback, > callbacks should not be queued until the created callback starts to run.
(In reply to comment #4) > Also (from bug 22991): > > > - With the exception of the created callback and the magic entered callback, > > callbacks should not be queued until the created callback starts to run. https://dvcs.w3.org/hg/webcomponents/rev/348757462b1f
https://dvcs.w3.org/hg/webcomponents/rev/4f25aa1b9a4b