Stylus Studio XML Editor

Table of contents

Appendices

1.3 Default actions and cancelable events

Default actions and cancelable events

Implementations may have a default action associated with an event type. An example is the [HTML40] form element. When the user submits the form (e.g. by pressing on a submit button), the event {"http://www.w3.org/2001/xml-events", "submit"} is dispatched to the element and the default action for this event type is generally to send a request to a Web server with the parameters from the form.

The default actions are not part of the DOM Event flow. Before invoking a default action, the implementation must first dispatch the event as described in the [DOM event flow].

A cancelable event is an event associated with a default action which is allowed to be canceled during the DOM event flow. At any phase during the event flow, the triggered event listeners have the option of canceling the default action or allowing the default action to proceed. In the case of the hyperlink in the browser, canceling the action would have the result of not activating the hyperlink. Not all events defined in this specification are cancelable events.

Different implementations will specify their own default actions, if any, associated with each event. The DOM Events specification does not attempt to specify these actions.

This specification does not provide mechanisms for accessing default actions or adding new ones.

NOTE: 

Some implementations also provide default actions before the dispatch of the event. It is not possible to cancel those default actions and this specification does not address them. An example of such default actions can be found in [DOM2HTML] on the HTMLInputElement.checked attribute.