W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: [DOMCore] Making event initializing easier

From: Doug Schepers <schepers@w3.org>
Date: Wed, 22 Jun 2011 12:31:58 -0400
Message-ID: <4E0218FE.3090809@w3.org>
To: Anne van Kesteren <annevk@opera.com>
CC: "www-dom@w3.org" <www-dom@w3.org>
Hi, Anne-

Anne van Kesteren wrote (on 6/22/11 11:42 AM):
> On Fri, 04 Mar 2011 11:25:45 +0100, Anne van Kesteren <annevk@opera.com>
> wrote:
>> If we indeed introduce objects into our APIs and I start to think that
>> would make sense I think the simplest approach that could possibly
>> work here is to overload initEvent(). In addition to its three
>> argument version it would get a version that accepts just one
>> argument, an object. From this object property values are queried to
>> set values on the event. E.g.
>>
>> var e = document.createEvent("CustomEvent")
>> e.initEvent({"type":"custom", "details":{"hello":"world"}})
>> document.dispatchEvent(e)
>
> https://bitbucket.org/ms2ger/dom-core/changeset/b9bb17789db9 is the
> specification text for this. I suspect it will propagate to the editors'
> drafts soon.
>
> Instead of overloading initEvent() I went with a new method init() based
> on a suggestion from Olli.
>
>
> So for each new event interface we define (and hopefully some of the
> recently-added ones too) the init*Event() is not to be included and
> instead a dictionary that inherits from InitEvent is to be included, as
> well as how that dictionary maps to the event, as illustrated in DOM Core.

I support this.  I wanted to make event initialization easier in DOM3 
Events, along the same lines, but got resistance on it.  If everyone 
agrees to this approach, I think it's a win.

I'll send more technical feedback when this is reflected in the spec.

Regards-
-Doug Schepers
W3C Staff Contact, SVG, WebApps, Web Events, and Audio WGs
Received on Wednesday, 22 June 2011 16:32:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:07 GMT