W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: Adopting a Custom Element into Another Document

From: Ryosuke Niwa <rniwa@apple.com>
Date: Tue, 13 Jan 2015 17:26:02 -0800
Cc: Anne van Kesteren <annevk@annevk.nl>, Webapps WG <public-webapps@w3.org>, Boris Zbarsky <bzbarsky@mit.edu>
Message-id: <076BAEF4-1116-476B-871C-107B4A04DBD1@apple.com>
To: Domenic Denicola <d@domenic.me>

> 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
Received on Wednesday, 14 January 2015 01:26:32 UTC

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