This repository was archived by the owner on Mar 19, 2018. It is now read-only.

Description
The 2nd argument to addEventListener
is an EventListener
callback interface. We could possibly add additional attribute members to this interface. Eg.
callback interface EventListener {
void handleEvent(Event event);
readonly attribute boolean mayCancel;
};
Event registration code would then look like:
element.addEventListener(type, {handleEvent: function(e) {
...
}, mayCancel: false});
This would separate capture
from mayCancel
but it makes some sense since mayCancel
is describing a property of the EventListener
. This would have the benefit of being backwards compatible (although we'd still want to encourage use of a polyfill to prevent accidentally depending on cancelable events). This would also avoid the need to change any of the language around the capture variable and what constitutes a redundant (and so ignored) event handler registration. However this seems like it might be an abuse of callback interfaces, is there precedent?