W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Re: [webcomponents]: Invocation order of custom element readyCallback

From: Scott Miles <sjmiles@google.com>
Date: Fri, 22 Mar 2013 09:35:46 -0700
Message-ID: <CAHbmOLYWxVWvh3U_Gd6vDk9tqsNaQL81SFSHw22CjHzyNTO=fQ@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: Hajime Morrita <morrita@google.com>, public-webapps <public-webapps@w3.org>
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).

Scott


On Fri, Mar 22, 2013 at 5:42 AM, Anne van Kesteren <annevk@annevk.nl> wrote:

> On Fri, Mar 22, 2013 at 6:27 AM, Hajime Morrita <morrita@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/
>
>
Received on Friday, 22 March 2013 16:36:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:58 GMT