[whatwg/dom] window.event and IFRAMEs (#735)

Imagine the following code, that is **executed from inside a same-origin `IFRAME`**:
```
top.addEventListener('load', function(e) {
  console.assert(typeof window.event === 'undefined')
  console.assert(typeof top.event === e)
})
```

That asserts that the event object should be retrievable from the same window where the target node (`top`) lives. 

These asserts pass in: Chrome 70, Edge 18, Safari 10-12, and IE 11
These asserts fail in: Chrome 71+, Firefox 63-65 (after changing `dom.window.event.enabled`), IE 10

There's some relevant discussion in the [Firefox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1527954).

The [Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=932154) I filed was folded into [another](https://bugs.chromium.org/p/chromium/issues/detail?id=664676), which is still open.

What should happen? On which global object should `event` be available? If the handler is bound to a node that moves between contexts, do we consider "bind time" or "callback time"?

Demo can be found [here](https://cvazac.netlify.com/window-dot-event/).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/735

Received on Thursday, 21 February 2019 20:09:22 UTC