addEventListener AddEventListenerOptions API

EventListenerOptions API was added in 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


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.



Working draft or equivalent

Status in Chromium


Enabled by default (tracking 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


Last updated on 2017-08-11