W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2009

Dropping (or deprecating) event initialization methods

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 18 Sep 2009 17:57:40 +1000
To: www-dom@w3.org
Message-ID: <20090918075740.GF7053@wok.mcc.id.au>
As has been pointed out, there are problems with the current pattern of
init* methods on event interfaces.  The below come to mind:

  * it is difficult to remember the arguments to them (initMouseEvent
    has 15!)

  * adding attributes to an interface would mean either adding an
    argument to the method (breaking binary compatibility for languages
    where that matters) or introducing a new one to override the first

  * adding attributes to a parent interface, like UIEvent, would mean
    that the intuitive argument order could not be kept in the child
    interface’s method

I suggest that we dispense with this pattern, and instead make all of
the attributes that these initializer methods would set writable.  If
assigned to during event dispatch, an exception would be thrown.  I
suppose some web content would rely on these methods currently, but I
would guess it’s not much.

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Friday, 18 September 2009 07:58:22 GMT

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