- From: Brad Pettit <bradp@microsoft.com>
- Date: Thu, 27 Jun 2002 13:02:28 -0700
- To: "Philippe Le Hegaret" <plh@w3.org>, "WWW DOM" <www-dom@w3.org>
>On Fri, 2002-05-31 at 20:41, Brad Pettit wrote: >> On Friday, May 31, 2002 11:41 AM, Philippe Le Hegaret wrote: >> >>Hitting enter on a focused element would trigger both the >> >>DOMActivate and Click event. >> >> I find the mixing of the event models confusing at best. For example, >> button.click() should result in the firing of both onClick and >> DOMActivate events, right? When do these events fire relative to each >> other, and when does the default action occur? >June 27, 2002: Philippe Le Hegaret >The following clarification seems appropriate: >"The activate event occurs when an element's default action is activated, for instance, thru a mouse click." This more specific example clarifies the issue: If a script were to call button.click(), and that resulted in the following events: 1. DOM 0 button::onClick handler is invoked. 1a. action is performed 2. DOM 2 button::DOMActivate event is invoked. 2a. action is performed. then the button's action would be executed twice unless the DOM2 handler tracked whether it had already been called. That makes backward compatibility difficult since the DOM0 handlers are added at attribute processing time, before DOM2 handlers may be registered. It also makes it more difficult for authors to handle both event mechanisms. How much consideration was given to the possibility of using the registration of a DOM2 handler as a means to prevent calls to the corresponding DOM 0 handler? That could address all of the ambiguity. Brad Pettit Microsoft Corp.
Received on Thursday, 27 June 2002 16:03:09 UTC