Re: [whatwg/dom] Removing event listeners through an identifier (#208)

@annevk Yeah, it's tied to the event listener and cannot (should not) be exposed to the event object. However, I do see @LeaVerou's perspective and had to think about this a few times.

The event object is constructed, like any other object, at the time the event is "happens". E.g. you can manually do `new Event('click')` and call `el.fireEvent`; or when the browser does it internally when processing user input). This must happen separately from event listeners, because 1) the code creating the event can't know the handlers, and 2) multiple handlers may exist for the same event – and the same event object is passed to each of the handlers. Think about the event object for `DOMContentLoaded`, or `window.onload` as extreme example. The parameter tends to be unused there, but it illustrates the issue.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/208#issuecomment-313230898

Received on Wednesday, 5 July 2017 21:23:46 UTC