W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

[Bug 20567] Change [[Prototype]] for concept-node-adopt?

From: <bugzilla@jessica.w3.org>
Date: Wed, 16 Oct 2013 00:48:03 +0000
To: public-script-coord@w3.org
Message-ID: <bug-20567-3890-LK8lz5XAQg@http.www.w3.org/Bugs/Public/>

--- Comment #39 from Dominic Cooney <dominicc@chromium.org> ---
(In reply to Bobby Holley (:bholley) from comment #38)
> (In reply to Dominic Cooney from comment #37)
> > Although Custom Elements are nascent I think a resolution of this bug has to
> > include a path for Custom Elements.
> Agreed.


> > We're currently in the Option 1 world. I think Option 1 is preferable
> > because it is simple; the handling of a node adopted into a different
> > document behaves the same way as a node removed from a document but kept
> > around with a reference from JavaScript. The downside is it is more leaky
> > than other options. However other options aren't leak-free anyway, so I
> > argue they're not worth the added complexity.
> I'm not sure I agree. The difference between leaking an entire scope in 10%
> of adoptNode and 100% of adoptNode calls matters a lot, at least in Gecko.

I'm not sure where the 10% and 100% numbers come from, but I assume you
estimate 10% of elements to be Custom Elements at some point in the future?

I was referring to the fact that nodes removed from a document but not adopted
into another document would leak. Does anyone have data?

> > In the implementation we got snared on brambles like
> > when to deliver the leftView callback for a Custom Element in the process of
> > changing prototypes.
> I don't understand why this is a problem. leftView fires when the node is
> removed from the document, which should occur before the adopt (which is
> what would trigger the reparent).

Unfortunately not true because of the timing of Custom Element callbacks. We
wanted to avoid the problems with Mutation Events running author script on
surprising UA native callstacks, while giving authors apparently synchronous
callbacks, so Custom Element callbacks are delayed until the UA is about to run
script again. In cases like appendChild doing an implicit adoption, this means
by the time you can run the leftView callback, the element is already in the
new document. So when should its prototype change? etc. We found this to be a
rabbit hole.

> > Explaining what is happening to the developer is super
> > complex and implies extra callbacks or something. We couldn't figure it out.
> I would like to try to figure it out together. :-)

Sure. We hashed and thrashed this out on bug 20488 and ended up blocking on
this one.

> > I'm happy to go into details but maybe video chat with interested parties
> > will be quicker than bug threads.
> That's fine with me. Note that I'm in Europe until early November, so
> earlier in the day would be better. It would also be helpful to have Blake
> around, since I know next to nothing about Web Components. And Blake's been
> absent lately. I'll ping him to see if he's around.

I'm in JST but I'm happy to talk any time of the day or night.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 16 October 2013 00:48:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:18 UTC