W3C home > Mailing lists > Public > www-archive@w3.org > December 2005

"Web Applications 1.0", 2.2.3. Event listeners

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 15 Dec 2005 14:25:12 +0100
To: ian@hixie.ch
Cc: www-archive@w3.org
Message-ID: <usq2q1hf8h23gn0maft79tengqs9b9pif0@hive.bjoern.hoehrmann.de>

Hi,

  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").

  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.

regards,
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Thursday, 15 December 2005 13:25:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:32:46 UTC