RE: Adopting a Custom Element into Another Document

2015-01-14 Thread Domenic Denicola
From: Anne van Kesteren [mailto:ann...@annevk.nl] > Because it's very easy to move nodes from one tree to another and this > happens quite a bit through and such. If the then goes away > it would be a shame to have to leak it forever. This is all discussed to > great extent in the aforementi

Re: Adopting a Custom Element into Another Document

2015-01-14 Thread Anne van Kesteren
On Tue, Jan 13, 2015 at 8:43 PM, Domenic Denicola wrote: > Why is the tree data structure embodied by the DOM any different? Because it's very easy to move nodes from one tree to another and this happens quite a bit through and such. If the then goes away it would be a shame to have to leak it

Re: Adopting a Custom Element into Another Document

2015-01-14 Thread Anne van Kesteren
On Tue, Jan 13, 2015 at 8:36 PM, Ryosuke Niwa wrote: > I'm not sure I understand what you mean by that. The name of the new class > MyElementB isn't important. > > Do you agree that the author has to create a new class in B if there is no > definition of MyElement there? Yes. > But how do we

Re: Adopting a Custom Element into Another Document

2015-01-13 Thread Ryosuke Niwa
> On Jan 13, 2015, at 11:43 AM, Domenic Denicola wrote: > > I imagine this has all been discussed before, but why do __proto__-munging > when adopting cross document? That seems bizarre, and causes exactly these > problems. When you put an object in a Map from another realm, it doesn't > __pr

Re: Adopting a Custom Element into Another Document

2015-01-13 Thread Boris Zbarsky
On 1/13/15 2:43 PM, Domenic Denicola wrote: Why is the tree data structure embodied by the DOM any different? The issue is not the tree structure but rather 1) what it means to have a certain document as your ownerDocument and 2) Whether there are footguns here that make it too easy for autho

RE: Adopting a Custom Element into Another Document

2015-01-13 Thread Domenic Denicola
Why is the tree data structure embodied by the DOM any different? -Original Message- From: Ryosuke Niwa [mailto:rn...@apple.com] Sent: Tuesday, January 13, 2015 14:37 To: Anne van Kesteren Cc: Webapps WG; Boris Zbarsky Subject: Re: Adopting a Custom Element into Another Document On Jan 13

Re: Adopting a Custom Element into Another Document

2015-01-13 Thread Ryosuke Niwa
On Jan 13, 2015, at 11:27 AM, Anne van Kesteren wrote: > On Tue, Jan 13, 2015 at 8:15 PM, Ryosuke Niwa wrote: >> By "the same thing", do you mean that they will manually change __proto__ >> themselves? > > Yes. > > >> Let's say we have MyElement that inherits from HTMLElement and we're >> ado

Re: Adopting a Custom Element into Another Document

2015-01-13 Thread Anne van Kesteren
On Tue, Jan 13, 2015 at 8:15 PM, Ryosuke Niwa wrote: > By "the same thing", do you mean that they will manually change __proto__ > themselves? Yes. > Let's say we have MyElement that inherits from HTMLElement and we're > adopting an instance of this element (let's call it myElement) from a > do

Re: Adopting a Custom Element into Another Document

2015-01-13 Thread Ryosuke Niwa
On Jan 13, 2015, at 7:05 AM, Anne van Kesteren wrote: > On Tue, Jan 13, 2015 at 6:15 AM, Ryosuke Niwa wrote: >> As far as I tested, WebKit and Blink keep the old __proto__ while Gecko >> changes it to the adopted document's prototype. There is a bug in DOM >> component about this: >> https://

Re: Adopting a Custom Element into Another Document

2015-01-13 Thread Anne van Kesteren
On Tue, Jan 13, 2015 at 6:15 AM, Ryosuke Niwa wrote: > Have you settled the question of what happens to a custom element that's > adopted into another document? More or less... > As far as I tested, WebKit and Blink keep the old __proto__ while Gecko > changes it to the adopted document's pro