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

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

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Tue, 24 Apr 2012 22:23:07 +0300
Message-ID: <4F96FD9B.5080100@helsinki.fi>
To: Travis Leithead <travis.leithead@microsoft.com>
CC: "public-webapps@w3c.org" <public-webapps@w3c.org>, "Anne van Kesteren (annevk@opera.com)" <annevk@opera.com>, Jacob Rossi <Jacob.Rossi@microsoft.com>
On 04/24/2012 09:43 PM, Travis Leithead wrote:
> 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?
AFAIK, yes


> 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.
Sounds like a bug. That wasn't the intention when isTrusted was added.

> 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?
Yes. It should be possible to re-dispatch events. But if a script
running on a web page dispatches event, the event must become
untrusted.


-Olli


> 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.
>
> -Travis
>
>
Received on Tuesday, 24 April 2012 19:24:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:51 GMT