WICG / EventListenerOptions

An extension to the DOM event pattern to allow authors to disable support for preventDefault
Other
1.17k stars 140 forks source link

Need some additional text around add/removeEventListener clearly specifying how equality works #23

Closed dtapuska closed 8 years ago

dtapuska commented 8 years ago

Take for example:

var f = function(e) { };

addEventListener("foo", f, false); /use capture false; mayCancel implicitly true/ addEventListener("foo", f, {useCapture: false, mayCancel: true}); /* this should do nothing; since f is already added with those args. */

Likewise: removeEventListener("foo", f, {useCapture: false, mayCancel: true}); /* this should remove the first added event listener*/

This slightly differs from the text in http://www.w3.org/TR/dom/#dom-eventtarget-removeeventlistener as the EventListenerOptions object is likely created and destroyed between add/remove calls so we need to enumerate all the configurations of the options to determine if they are equal. This may be specified somewhere how dictionaries behave; but I haven't found a reference to it.

RByers commented 8 years ago

Covered by #19, eg. here