W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Re: Custom Elements: insert/remove callbacks

From: Elliott Sprehn <esprehn@chromium.org>
Date: Sat, 9 May 2015 10:11:46 -0700
Message-ID: <CAO9Q3iL=V9amVHjaHChZQ62i8hUoMkCsYZQhKwBeFzKFzBU1KA@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: public-webapps <public-webapps@w3.org>, Boris Zbarsky <bzbarsky@mit.edu>
On May 9, 2015 9:41 AM, "Anne van Kesteren" <annevk@annevk.nl> wrote:
>
> On Fri, May 8, 2015 at 2:50 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> > On 5/8/15 1:42 AM, Elliott Sprehn wrote:
> >> That actually seems pretty similar to what we have, ours is in the form
> >> of:
> >>
> >> Node#insertedInto(Node insertionPoint)
> >> Node#removedFrom(Node insertionPoint)
> >
> > To be clear, ours is also in the form of two methods
> > (BindToTree/UnbindFromTree) that take various arguments.
>
> The DOM only has insert/remove hooks:
>
>   https://dom.spec.whatwg.org/#concept-node-insert-ext
>   https://dom.spec.whatwg.org/#concept-node-remove-ext
>
> So that seems clearly wrong (in the specification)... Are descendants
> notified in tree order?

Yes, and anything that can run script is notified in a second pass. So for
example if you create a script, put it in a subtree, then append the
subtree, the script runs after all insertedInto notifications have been
sent to the subtree.

- E
Received on Saturday, 9 May 2015 17:12:15 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC