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

Re: Adopting a Custom Element into Another Document

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 13 Jan 2015 20:27:13 +0100
Message-ID: <CADnb78huyqRmntuWRDdkHu2MT-R0R5JdKnBP18Cdj54TSnpxiA@mail.gmail.com>
To: Ryosuke Niwa <rniwa@apple.com>
Cc: Webapps WG <public-webapps@w3.org>, Boris Zbarsky <bzbarsky@mit.edu>
On Tue, Jan 13, 2015 at 8:15 PM, Ryosuke Niwa <rniwa@apple.com> 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
> document A to document B; MyElement is currently defined in A's global
> object.
>
> I have two questions:
>
> Why did we decide to let custom elements handle this themselves instead of
> doing it in the browser?

With two realms it's not a given that both realms use the same custom
element registry. (As you acknowledge.)


> When "myElement" is adopted into B, there is no guarantee that MyElement is
> also defined in B.  Does that mean MyElement may need to create another
> class, let us call this MyElementB, in the B's context that inherits from
> B's HTMLElement?

Well, if you control both realms I would assume you would give the same name.


> Didn't Boris say Gecko needs to do this synchronously in order to enforce
> their security policy?

I don't think that's conclusive, though if it turns out that's the
case we would need different timing between normal and custom
elements, yes.


-- 
https://annevankesteren.nl/
Received on Tuesday, 13 January 2015 19:27:41 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC