Re: [heycam/webidl] Is a subclass still a platform object? (#540)

Hrm.  In the end you're executing `frames[0].EventTarget` and that's defined to create objects in its own global...  The WebIDL spec used to clearly say that when you create things via a constructor they are associated with that constructor's global, but I don't see that text in there now.  @tobie, @domenic, did it get lost in one of the refactorings or something?

Anyway, here's a less-magical testcase for this:

    <iframe></iframe>
    <script>
    class X extends frames[0].Image {};
    obj = new X();
    w(obj.ownerDocument == document);
    w(obj.ownerDocument == frames[0].document);
    </script>

(live at <http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=5856>).  And yes, Firefox and Chrome disagree here.  Firefox logs `false` then `true`, while Chrome logs `true` then `false`.

Safari logs `false` then `true` (but also doesn't create the object with X.prototype as the proto, of course).  Edge behaves like Safari.

Given that, sounds like Chrome is the odd one out in terms of what it does here....

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/540#issuecomment-379008535

Received on Thursday, 5 April 2018 17:12:01 UTC