W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

[DOM3 Events/DOM4] re-dispatching trusted events with initEvent

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Tue, 24 Apr 2012 18:43:16 +0000
To: "public-webapps@w3c.org" <public-webapps@w3c.org>, "Anne van Kesteren (annevk@opera.com)" <annevk@opera.com>
CC: Jacob Rossi <Jacob.Rossi@microsoft.com>
Message-ID: <9768D477C67135458BF978A45BCF9B383830A0BC@TK5EX14MBXW602.wingroup.windeploy.ntdev.microsoft.com>
Based on my reading of DOM4, initEvent makes it possible to transform a trusted event into a non-trusted event and dispatch it. Is that intentional? It is only currently supported in Firefox and Opera. In IE, Chrome and Safari, the initEvent call is ignored in this scenario. After the initEvent call is ignored, Chrome will allow you to dispatch the event (unchanged), IE will not (per the prose currently in DOM3 Events). Note, chrome doesn't report the "isTrusted" property, so I can't tell if initEvent would have set that flag to false (hope so)!

I'm trying to rationalize the behavior between DOM3 and DOM4. 

DOM3 Events was pretty clear that you can't dispatch an event that wasn't created with createEvent. Pretty simple. That's contrary to DOM4 at the moment (which allows it as long as it's been initialized); I wonder if there needs to be another check to prevent re-dispatching a trusted event?. Is there a specific reason for the current behavior?

DOM3 Events is not very clear about initEvent at the moment. Should it be allowed to convert a trusted event to a non-trusted event? Seems like trouble. Given that IE9 and Chrome/Safari don't allow it, it won't be a compatibility issue to disallow it.

Let's come to an agreement on this so that the two specs can be harmonious on this point.


Received on Tuesday, 24 April 2012 18:43:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:33 UTC