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.
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.