Re: [webcomponents]: Invocation order of custom element readyCallback
On Sat, Mar 23, 2013 at 3:25 AM, Dimitri Glazkov dglaz...@chromium.orgwrote: On Fri, Mar 22, 2013 at 9:35 AM, Scott Miles sjmi...@google.com wrote: In our work, we adopt a composition rule that a node knows about it's own children and can have expectations of them, but can make no assumptions about it's parent or siblings. As a coding model we've found it to be deterministic enough to build sane constructions. For example, you can use methods/properties on your children, but should only fire events upward. Yup. My assumption was that for a custom element, its children matter more than its parent or siblings. Therefore, our polyfills have an invariant that custom elements are prepared bottom-up (i.e. my children are all upgraded before I am). Intuitively, I agree with Scott. Which means that the callback queue is LIFO, right? Ah right. This sounds simple enough to be explained... and to be implemented :-) :DG -- morrita
Re: [webcomponents]: Invocation order of custom element readyCallback
On Fri, Mar 22, 2013 at 6:27 AM, Hajime Morrita morr...@google.com wrote: So what about (B): Call x-child first and x-parent second? This solves the unreadified x-child problem. And you will have a parent that is not ready. Or if you have fb-1/fb-2/ you'll either have a previousSibling or nextSibling, depending on invocation order, that's not ready. Or am I missing something? -- http://annevankesteren.nl/
Re: [webcomponents]: Invocation order of custom element readyCallback
On Fri, Mar 22, 2013 at 8:42 AM, Anne van Kesteren ann...@annevk.nl wrote: On Fri, Mar 22, 2013 at 6:27 AM, Hajime Morrita morr...@google.com wrote: So what about (B): Call x-child first and x-parent second? This solves the unreadified x-child problem. And you will have a parent that is not ready. Or if you have fb-1/fb-2/ you'll either have a previousSibling or nextSibling, depending on invocation order, that's not ready. Or am I missing something? Nope. You got it. No matter which order we spec there will always be a way to observe custom elements that have not yet done their createdCallback. The question is just which order is better? -- erik
Re: [webcomponents]: Invocation order of custom element readyCallback
On Fri, Mar 22, 2013 at 9:35 AM, Scott Miles sjmi...@google.com wrote: In our work, we adopt a composition rule that a node knows about it's own children and can have expectations of them, but can make no assumptions about it's parent or siblings. As a coding model we've found it to be deterministic enough to build sane constructions. For example, you can use methods/properties on your children, but should only fire events upward. Therefore, our polyfills have an invariant that custom elements are prepared bottom-up (i.e. my children are all upgraded before I am). Intuitively, I agree with Scott. Which means that the callback queue is LIFO, right? :DG