W3C home > Mailing lists > Public > www-archive@w3.org > May 2007

Re: "Web Applications 1.0", 2.2.3. Event listeners

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 24 May 2007 21:59:49 +0000 (UTC)
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: www-archive@w3.org
Message-ID: <Pine.LNX.4.62.0705242153150.23432@dhalsim.dreamhost.com>

On Thu, 15 Dec 2005, Bjoern Hoehrmann wrote:
>   http://whatwg.org/specs/web-apps/current-work/ has in 2.2.3. Event
> listeners
>   In the ECMAScript DOM binding, the ECMAScript native Function type
>   must implement the EventListener interface such that invoking the
>   handleEvent() method of that interface on the object from another
>   language binding invokes the function itself, with the event argument
>   as its only argument. In the ECMAScript binding itself, however, the
>   handleEvent() method of the interface is not directly accessible on
>   Function objects.
> This basically just restates what's already in the DOM Level 2/3 Events
> ECMAScript bindings, if this is really needed it should refer to the
> relevant specification (e.g., "... as defined in DOM Level 3 Events").

Could you point me to the relevant part in DOM2/3 Events?

>   If the function returns false, the event's preventDefault() method
>   must then invoked. Exception: for historical reasons, for the HTML
>   mouseover event, the preventDefault() method must be called when the
>   function returns true instead.
> This does not seem to reflect current implementations well, as far as
> I can tell the return value has no impact on the event state if the
> listener is registered using e.g. addEventListener or if non-HTML event
> attributes (e.g. onclick="" in SVG 1.1) are used (except for Opera9),
> so this would only apply to HTML's event attributes, and for those it
> does not reflect well what IE6 does, for e.g.
>   <p onclick="return true;">...<a href="..." onclick='return
>      false;'>...</a>...</p>
> the default action won't be prevented (it would in Opera/FireFox 
> however). So it seems the remarks about calling preventDefault should be 
> moved to the next paragraph which applies only to the HTML event 
> attributes, rather than ECMAScript DOM bindings in general.

Done. Thanks.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 24 May 2007 21:59:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:43:11 UTC