W3C home > Mailing lists > Public > public-webapi@w3.org > March 2007

Re: DOM Events

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 29 Mar 2007 17:34:43 +0200
To: Stewart Brodie <stewart.brodie@antplc.com>
Cc: public-webapi@w3.org
Message-ID: <qnmn0358o03eh0bdv62itanv9as43fed56@hive.bjoern.hoehrmann.de>

* Stewart Brodie wrote:
>Where the DOM Level 3 Events document is lacking, in my opinion, is that it
>does not say enough about dispatch of events to objects that implement
>EventTarget but do not implement Node.  In my DOM implementation, my
>XMLHttpRequest objects implement EventTarget.  Quite how this fits with
>capturing, at-target and bubbling phases or default event handlers isn't
>100% clear to me - although in this case, I think it is obvious that you
>just get an at-target phase. But what about other non-Node objects that are
>arranged in a tree hierarchy? Also, *I* think it's obvious, but somebody
>else might think that some other behaviour is equally obvious.

How events flow through a data structure is controlled by the event flow
associated to the event targets making up the structure. DOM Level 3
Events defines one such event flow, the DOM Event Flow. Another event
flow is defined in DOM Level 3 L&S, which is the example given in the
draft. The next draft will define better terminology to help defining
new event flows in a manner compatible with the DOM Event model. I would
expect the XHR specification would say something like, that the propa-
gation path consists of only the xhr object, to define its event flow.

>To be honest, I do not understand fully under what conditions canDispatch()
>can return FALSE other than either the namespaceURI or type is invalid
>according to the naming rules for those strings.  But if that is all that it
>can do, then perhaps it would better to remove it completely and rely on
>dispatchEvent raising INVALID_CHARACTER_ERR exceptions as appropriate.

The purpose of the method is to allow scripts to query whether the DOM
implementation is prepared to automatically generate and dispatch events
of the specified type, for example, whether it will report the download
progress of referenced resources using the 'progress' event as discussed
on this list.
-- 
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, 29 March 2007 15:34:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:57 GMT