- From: Maciej Stachowiak <mjs@apple.com>
- Date: Tue, 14 Mar 2006 14:12:24 -0800
- To: Jim Ley <jim@jibbering.com>
- Cc: public-webapi@w3.org
On Mar 14, 2006, at 12:19 PM, Jim Ley wrote:
>
> "Maciej Stachowiak" <mjs@apple.com>
>> In DOM Level 2 Events, the order in which event listeners trigger
>> was undefined. DOM Level 3 Events will specify an ordering, which
>> is the order in which they are added.
>
> I'm not sure I see the motivation for this, it's not backwards
> compatible, I cannot see it has any usecases - why not leave it an
> undefined ordering?
I don't know what you mean by "not backwards compatible". Content
can't possibly be relying on the ordering being undefined, so
specifying the ordering can't break things. It is better for
interoperability if the order is defined instead of arbitrary, code
tested in one UA will be more likely to work in others.
> In fact I see many more use cases for being able to explicit set a
> later defined event should be fired first, rather than forcing it
> to last - e.g. so you can prevent all listeners you've not added
> from responding.
That's an interesting idea but clearly requires the ordering to be
defined, and requires a new mechanism to add an earlier event
listener. Maybe something that could be looked at post DOM Level 3
Events.
>
>> so the Firefox order would compl with the new spec.
>
> so should foo.onclick fire before or after foo.setAttribute
> ('onclick',... ) ? :-)
Only one of them will fire, and whichever is set last wins. There's
no need to define relative ordering since you can't have both at the
same time.
Regards,
Maciej
Received on Tuesday, 14 March 2006 22:12:45 UTC