> On Jan 13, 2015, at 11:43 AM, Domenic Denicola <d...@domenic.me> 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 > __proto__-munge it to that other realm's Object.prototype. Why is the tree > data structure embodied by the DOM any different?
Indeed, it's strange that we only do this for DOM nodes. Furthermore, copying a custom element's class definition into the destination document without leaking the source document's global object is hard since methods of the class may capture the global object. We need to do something inelegant like re-loading the script in the destination. - R. Niwa