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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20567

--- Comment #40 from Bobby Holley (:bholley) <bobbyholley@gmail.com> ---
(In reply to Dominic Cooney from comment #39)
> > > include a path for Custom Elements.
> > Agreed.
> Great!

Just to be clear - this doesn't mean that I think that Custom Elements should
drive what we do here irregardless of other considerations. It's possible that
the Web Components spec will need to change. But I agree that we should at
least have a plan in mind. :-)

> > 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.

I was talking about the case where document.open ejects all the nodes and
leaves them behind in the old window, but still keeping a reference to the node
in script. This leaks the old scope until the reference goes away. But my point
is that this is a much narrower case than "every time a node is adopted
cross-scope", and that matters a lot when we're talking about performance IMO.
Also, there's disagreement about whether document.open is even in-scope for
this bug.

> Does anyone have data?

I don't really know what meaningful data would look like on this. Also, this:
http://bit.ly/17J9kc3 ;-)

> > 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.

I see. How about we just make adoptNode throw for any element with a binding? I
don't imagine anyone would complain too hard about that.

In general, we may not be able to find a perfect solution that gives web
developers the exact API that does everything they want. But I am strongly
against speccing a requirement that we do something leaky in a situation that
is quite common on the web.

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

Ok. I'm quite flexible schedule-wise as well. Blake just emailed me saying he
got back from vacation, and would weigh in on this thread soon.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Wednesday, 16 October 2013 09:05:34 UTC