Re: [heycam/webidl] State that by default all objects are created in the relevant realm of `this` (#135)

Another issue is static methods. At least with Chrome and Firefox and at least with `DOMRect`, static factory functions use the **current** realm for the newly created object:

```js
// $0 is a same-origin synchronously-accessible iframe
rect = $0.contentWindow.DOMRect.fromRect.call(DOMRect);
rect.constructor === $0.contentWindow.DOMRect // true
```

Firefox also has this weird bug where `rect instanceof DOMRect` and `rect instanceof $0.contentWindow.DOMRect` both return true, but the `.constructor` check seems to work as expected.

-- 
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/135#issuecomment-623037866

Received on Sunday, 3 May 2020 01:16:26 UTC