How we built it

addEventListener AddEventListenerOptions API

EventListenerOptions API was added in https://www.chromestatus.com/features/5718574840676352 The spec was revised to add AddEventListenerOptions which is a dictionary only for addEventListener(...) so that fields could be added that did not make up the matching key. This change is to move the add the AddEventListenerOptions dictionary definition, change the API and move the 'passive' field from EventListenerOptions to AddEventListenerOptions

Comments

The dictionary itself is not observable to JavaScript. The main change is the semantics of remove. In M51; addEventListener('touchstart', func, {passive: true}); addEventListener('touchstart', func, {passive: false}); would end up adding two listeners. But since passive is no longer part of the key; in M52; the second add will be a no-op. The key is made up of only 3 args; eventtype, listener function, capture.

Documentation

Specification

Working draft or equivalent

Status in Chromium

Enabled by default (launch bug) in:

  • Chrome for desktop release 52
  • Chrome for Android release 52
  • Android WebView release 52
  • Opera release 39
  • Opera for Android release 39

Consensus & Standardization

Owner

Last updated on 2016-08-29