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.
CustomEvent
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.EventTarget
EventTarget.hasEventListenerNS()
and EventTarget.willTriggerNS()
have been removed.EventTarget.dispatchEvent()
now raises an exception if the Event.type
attribute is syntactically invalid.Event
Event.isCustom()
has been removed; it is not longer necessary due to the changes made to the CustomEvent
interface.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.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.
This new specification introduced two new concepts in the event flow:
Event.stopPropagation()
does no longer stop the event propagation entirely. It only stops it for a given event group.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.
Event
Event
interface has a new attribute Event.namespaceURI
, and a four new methods: Event.isCustom()
, Event.stopImmediatePropagation()
, Event.isDefaultPrevented()
, and Event.initEventNS
.EventTarget
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.DocumentEvent
DocumentEvent
interface has one new method: DocumentEvent.canDispatch(namespaceURI, type)
.UIEvent
UIEvent
interface has a new method UIEvent.initUIEventNS(...)
.MouseEvent
MouseEvent
interface has two new methods MouseEvent.getModifierState(keyIdentifierArg)
and MouseEvent.initMouseEventNS(...)
.MutationEvent
MutationEvent
interface has a new method MutationEvent.initMutationEventNS(...)
.EventException
DISPATCH_REQUEST_ERR
constant has been added.The interfaces CustomEvent
, TextEvent
, KeyboardEvent
, and MutationNameEvent
were added to the Events module.