13 April 2006

Appendix B: Changes

Björn Höhrmann
Philippe Le Hégaret, W3C (until November 2003)

B.1 Changes since November 2003

Numerous clarifications to the interfaces and event types have been made. The HTMLEvents module is no longer defined in this document. The event types focus and blur have been added to the UIEvents module. For changes to the introduction of namespaces see Compatibility with DOM Level 2 Events.

Interface CustomEvent
Objects that implement the CustomEvent interface are now created by the implementation through DocumentEvent.createEvent(). Applications can no longer create their own Event objects and have them dispatched by the DOM implementation. The interface members associated with this functionality have been removed and the CustomEvent.initCustomEventNS() method has been added.
Interface EventTarget
The methods EventTarget.hasEventListenerNS() and EventTarget.willTriggerNS() have been removed.
EventTarget.dispatchEvent() now raises an exception if the Event.type attribute is syntactically invalid.
Interface Event
The method Event.isCustom() has been removed; it is not longer necessary due to the changes made to the CustomEvent interface.
The method Event.isDefaultPrevented() has been turned into an attribute named Event.defaultPrevented.
Event.timeStamp is now a Number in the ECMAScript binding; a proposed correction to make the same change in [DOM Level 3 Core] is forthcoming.

B.2 Changes between DOM Level 2 Events and DOM Level 3 Events

Note: This section lists changes between DOM Level 2 Events and the DOM Level 3 Events Working Group Note published November 2003. This section will be merged with the preceding section (and list only changes between DOM Level 2 Events and this specification) in a future draft of this document.

This new specification provides a better separation between the DOM event flow, the event types, and the DOM interfaces.

B.2.1 Changes to DOM Level 2 event flow

This new specification introduced two new concepts in the event flow:

  • event groups: unlike DOM Level 2 Events, Event.stopPropagation() does no longer stop the event propagation entirely. It only stops it for a given event group.
  • partial ordering of event listeners: within an event group, event listeners are now ordered while ordering was unspecified in DOM Level 2 Events.

B.2.2 Changes to DOM Level 2 event types

Lots of clarifications have been made on the event types. The conformance is now explicitly defined against the event types, and not only in terms of interfaces required by the event types. Support for namespaces and the features "BasicEvents", "TextEvents", "KeyboardEvents", and "MutationNameEvents" have been introduced.

The DOM Level 2 Event load event type can now be dispatched to more [HTML 4.01] elements. blur and focus have been clarified and restricted to [HTML 4.01] applications only.

B.2.3 Changes to DOM Level 2 Events interfaces

Interface Event
The Event interface has a new attribute Event.namespaceURI, and a four new methods: Event.isCustom(), Event.stopImmediatePropagation(), Event.isDefaultPrevented(), and Event.initEventNS.
Interface EventTarget
The EventTarget interface has four new methods: EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup), EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture), EventTarget.willTriggerNS(namespaceURI, type), EventTarget.hasEventListenerNS(namespaceURI, type). The method EventTarget.dispatchEvent(evt) was modified.
Interface DocumentEvent
The DocumentEvent interface has one new method: DocumentEvent.canDispatch(namespaceURI, type).
Interface UIEvent
The UIEvent interface has a new method UIEvent.initUIEventNS(...).
Interface MouseEvent
The MouseEvent interface has two new methods MouseEvent.getModifierState(keyIdentifierArg) and MouseEvent.initMouseEventNS(...).
Interface MutationEvent
The MutationEvent interface has a new method MutationEvent.initMutationEventNS(...).
Exception EventException
The DISPATCH_REQUEST_ERR constant has been added.

B.2.4 New Interfaces

The interfaces CustomEvent, TextEvent, KeyboardEvent, and MutationNameEvent were added to the Events module.