Contact emails
Spec
https://dom.spec.whatwg.org/#interface-eventtarget
Summary
Make the first two arguments (type and listener) of addEventListener and removeEventListener non-optional, matching the spec and other engines.
Motivation
That these have ever been optional is, as far as I can tell, an accident of WebKit history, it doesn't actually make sense, and it masks non-trivial programming errors.
In Gecko and Edge, these arguments are not optional, so emitting them will throw a TypeError.
Interoperability and Compatibility Risk
The change is motivated by interop concerns, although it's not on the interop hotlist and I'm not aware of specific problems in the wild.
As for compat, Edge has fortunately not copied this quirk, which is promising.
Something like addEventListener('foo') has been tickling the use counter for a while, and has been blocking this change. It has begun dropping, but it's not because of a new stable release. It's likely that making the change will reveal the source, and hopefully it's not in a library...
When trying to fix this I found internal uses of removeEventListener(listener), a form which looks sensible but doesn't actually do anything. I would also expect to see some of this in the wild.
All use counters:
Ongoing technical constraints
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
OWP launch tracking bug
Link to entry on the feature dashboard
https://www.chromestatus.com/features/5640816202612736
Requesting approval to ship?
Yes. The problematic usage has begun to fall and we're right after a branch, so there's no time like now!--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.