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

Re: [DOMCore] Making event initializing easier

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 28 Jun 2011 10:10:54 +1200
To: Anne van Kesteren <annevk@opera.com>
Cc: Ian Hickson <ian@hixie.ch>, "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <20110627221054.GC3167@wok.mcc.id.au>
Anne van Kesteren:
> Cameron, could you review step four (the step about dictionaries) of
> the event constructor algorithm:
> http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-constructor
> (It references several terms from Web IDL.)

That looks terminologically sound. :-)

The only thing that stands out is that there’s a kind of double
initialisation happening; for example on CustomEvent it’s stated:

  The detail attribute must return the value it was initialized to. When
  an event is created the attribute must be initialized to null.

So when step 1 of the event constructor algorithm is run, detail will be
initialised to null.  Then, when step 4 runs, this will again initialise
detail to be whatever value the corresponding dictionary member has.

It also seems like it would be superfluous to define in the IDL that the
detail dictionary member has a default value of null, while also stating
this in the prose.  But I guess that might be necessary if createEvent()
doesn’t have anything to do with the event constructor.

Maybe then it’d be better not to use the default values for the
dictionary members, and rely on the initialisation of those members
happening due to the prose?

Cameron McCormack ≝ http://mcc.id.au/
Received on Monday, 27 June 2011 22:11:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:17 UTC