Re: Custom Elements: insert/remove callbacks

On Thu, May 7, 2015 at 10:24 PM, Anne van Kesteren <annevk@annevk.nl> wrote:

> On Thu, May 7, 2015 at 10:14 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> > In Gecko, yes.  The set of hooks Gecko builtin elements have today is,
> > effectively:
> >
> > 1)  This element used to not have a parent and now does.
> > 2)  This element has an ancestor that used to not have a parent and now
> >     does.
> > 3)  This element used to have a a parent and now does not.
> > 4)  This element has an ancestor that used to have a parent and
> >     now does not.
>
> So that is more granular than what Dominic said Chrome has. I wonder
> why there's a difference. Normally at the low-level things are pretty
> close (or have a difference like linked list vs array).


That actually seems pretty similar to what we have, ours is in the form of:

Node#insertedInto(Node insertionPoint)
Node#removedFrom(Node insertionPoint)

where insertionPoint is the ancestor in the tree where a connection was
added or removed which may be arbitrarily far up the ancestor chain. From
that you can figure out all the cases Boris is describing.

- E

Received on Friday, 8 May 2015 05:43:23 UTC