[whatwg/dom] Should we really support modifying an already dispatched event via initEvent()? (#523)

It is currently possible (as per the DOM specification) to modify the attributes on an event (e.g. its type) after it has already been dispatched using any of the init*Event() functions.

This has been supported by Gecko for a long time I believe. WebKit and Blink have fairly recently aligned with Firefox it seems (tested via http://jsbin.com/mekobayoxu/edit?html,output).

Some of the WebKit engineers have expressed concerns about this so I thought I would start a discussion upstream about possibly changing this.

The concerns are:
1. It used to be (in WebKit/Blink) that Events were somewhat immutable after being dispatched. As a result, the page could hold on to the events and read their attributes later, without having to worry about the event changing under them.
2. It used to be (in WebKit/Blink) that Events could not be re-dispatched after being dispatched. Support such re-dispatching does not seem very useful and is a potential source of trouble because engines tend to store browser-internal properties on events (e.g. underlying platform keyboard event) and we need to be extremely careful that those are properly reset before re-dispatching.

Any thoughts?

-- 
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/523

Received on Friday, 27 October 2017 20:01:11 UTC