[whatwg/dom] Add a fully active check for EventTarget in event listener inner invoke (PR #1085)

This adds a fully active check in https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke that skips running event listeners if the EventTarget's realm's global's document is not fully active. Blink, Gecko, and WebKit were all skipping these event listeners, but the spec does not currently reflect this behavior.

I put the check where Blink and WebKit have it — just after the event listener was removed if it is a one-off. My understanding of Gecko's implementation is that the listeners are cleared on frame detach, so this should be compatable. The position of the check could be web observable if the document becomes fully active again, i.e. with bfcache, but Chromium at least [doesn't cache pages with opener references](https://web.dev/bfcache/#avoid-window.opener-references).

Closes #1084.

- [ ] At least two implementers are interested (and none opposed):
   * Chromium
   * …
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://chromium-review.googlesource.com/c/chromium/src/+/3691385

- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chrome: …
   * Firefox: …
   * Safari: …
   * Deno (only for aborting and events): …
   * Node.js (only for aborting and events): …

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/1085


-- Commit Summary --

  * Add a fully active check for EventTarget in event listener inner invoke

-- File Changes --

    M dom.bs (7)

-- Patch Links --

https://github.com/whatwg/dom/pull/1085.patch

https://github.com/whatwg/dom/pull/1085.diff


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1085

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1085@github.com>

Received on Wednesday, 8 June 2022 17:21:26 UTC