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

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