FW: Events review part II: 4.3 Interaction Events

Hi Jerome,

thanks for your feedback. I am reading the DOM Events spec little differently:

* CAPTURE: the event goes down from doc node to the target node
* TARGET: the event reaches its target.
* BUBBLING the event goes back up to the doc node
Event can be cancelled at any stage by calling event.preventDefault().

This far we agree, but:

Default actions are executed at each element within the normal event flow (in each element after the listeners AT THAT ELEMENT).

So there is no 4th event phase where the default actions are executed, but instead they are executed within the normal
capture/bubbling phases.

So bubbling itself does not cause default action to be done twice. But bubbling an event without calling event.preventDefault() will
cause default actions of different elements to be excecuted.
Consider the following (X)HTML:

<a href="http://www.xsmiles.org">
  A link <p>continues</p>
  <img src="http://www.xsmiles.org/images/xsmiles.gif"/>
  <button></button>
</a>

In this case <a> element has default action (load URL) associated with 'click'. This default action is performed at bubbling phase
no matter what the events target is (<p>,<img>, <button> or itself).

So clicking the <button> child of <a>, <button> would perform its default action for 'click', and then the event would bubble to <a>
which would also do its default action. Unless <button>'s default action for 'click' would call event.preventDefault() or
event.stopPropagation().

-mikko

-----Original Message-----
From: www-forms-editor-request@w3.org
[mailto:www-forms-editor-request@w3.org]On Behalf Of Jérôme Nègre
Sent: 4. helmikuuta 2002 12:24
To: Mikko Honkala; www-forms-editor@w3c.org
Subject: Re: Events review part II: 4.3 Interaction Events

In my understanding of chapter 1.2.4 of DOM level 2 Event model, the process
is the following :

* the event goes down to the target node (it can be canceled during this
phase)
* the event goes up to the document node (it can still be canceled during
this phase)
* if the event wasn't canceled, the default processing is done.

I don't see why bubbling would cause the default processing to be done
twice.

Jérôme

Received on Monday, 4 February 2002 09:43:37 UTC