Warning:
This wiki has been archived and is now read-only.

DOM3 Events Semantic Requirements

From WEBAPPS
Jump to: navigation, search

WebAppsDOM3Events ⇨ DOM3 Events Semantic Requirements


Conformance

  • A DOM application may use the hasFeature(feature, version) method of the DOMImplementation interface with parameter values "Events" and "3.0" (respectively).
  • An implementation that returns true for "Events" and "3.0" will also return true for the parameters "Events" and "2.0".

Event Types

  • Each event is associated with a type, called event type.
  • The event type is composed of a local name and a namespace URI.
  • All events defined in this specification are in no namespace.

Basic interfaces

Event

  • An object which implements the Event interface is passed as the parameter to an EventListener.
  • To create an instance of the Event interface, use the DocumentEvent.createEvent("Event") method call.
  • The defaultPrevented attribute is used to indicate whether Event.preventDefault() has been called for this event.
  • The namespaceURI attribute indicates the associated with this event at initialization time.
  • The initEventNS method initializes the attributes of an Event object.
  • the namespaceURIArg of the initEventNS method specifies the namespace URI associated with this event.
  • If no namespace is available for the namesapaceURIArg, then it's value is null.
  • The stopImmediatePropagation method prevents other event listeners from being triggered.
  • The effects of the stopImmediatePropagation method are immediate.
  • The stopImmediatePropagation method does not prevent the default action from being invoked.

CustomEvent

  • The CustomEvent allows applications to provide contextual information about the event type.
  • Application-specific event types should have an associated namespace to avoid clashes with future general-purpose event types.
  • To create an instance of the CustomEvent interface, use the DocumentEvent.createEvent("CustomEvent") method call.
  • The initCustomEventNS method initializes attributes of a CustomEvent object.

EventTarget

  • The addEventListenerNS method registers an event listener, depending on the useCapture parameter.
  • The namespaceURI of the addEventListenerNS method specifies the Event.namespaceURI associated with the event for which the user is registering.
  • The type parameter of the addEventListenerNS method specifies the Event type associated with the event for which the user is registering.
  • The listener parameter of the addEventListenerNS method takes an object implemented by the user which implements the EventListener interface and contains the method to be called when the event occurs.
  • If the useCapture parameter of the addEventListenerNS method set to "true" indicates that the user wishes to add the event listener for the capture phase only.
  • If the useCapture parameter of the addEventListenerNS method set to "false" indicates that the event will be triggered during the target and bubbling phases.
  • The dispatchEvent method dispatches an event into the implementation's event model.
  • The event target of the event is the EventTarget object on which dispatchEvent is called (dispatchEvent method).
  • The dispatchEvent method raises an UNSPECIFIED_EVENT_TYPE_ERR exception if the Event.type was not specified by initializing the event before dispatchEvent was called.
  • The dispatchEvent method raises an EventException if the Event.type was set to null
  • The dispatchEvent method raises a DISPATCH_REQUEST_ERR exception if the Event object is already being dispatched.
  • The dispatchEvent method raises an NOT_SUPPORTED_ERR exception if the Event object has not been created using DocumentEvent.createEvent().
  • The dispatchEvent method raises an INVALID_CHARACTER_ERR exception if Event.type is not an NCName as defined in [XML Namespaces 1.1].
  • The removeEventListenerNS method removes an event listener.
  • Calling removeEventListenerNS with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.
  • The namespaceURI of the removeEventListenerNS method Specifies the Event.namespaceURI associated with the event for which the user registered the event listener.
  • The type parameter of the removeEventListenerNS method specifies the Event.type associated with the event for which the user is registering.
  • The listener parameter of the removeEventListenerNS method takes an object implemented by the user which implements the EventListener interface and contains the method to be called when the event occurs.
  • The removeEventListenerNS method removes an event listener.
  • Calling removeEventListenerNS method with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.

Event Creation

DocumentEvent

  • The canDispatch method tests if the implementation can generate events of a specified type.
  • The canDispatch method return true if the implementation can dispatch the event.
  • The canDispatch method return false if the implementation can not dispatch the event.
  • The namespaceURI parameter of the canDispatch method specifies the Event.namespaceURI of the event.
  • The type parameter of the canDispatch method specifies the Event.type of the event.

User Interface event types

UIEvent

  • The initUIEventNS method initializes attributes of an UIEvent object.
  • The initUIEventNS method has the same behavior as Event.initEventNS().
  • The namespaceURI parameter of the initUIEventNS method specifies Event.namespaceURI, the namespace URI associated with this event, or null if no namespace.
  • The typeArg parameter of the initUIEventNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initUIEventNS method specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initUIEventNS method specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
  • The viewArg parameter of the initUIEventNS method specifies UIEvent.view.
  • The viewArg parameter of the initUIEventNS method can be null
  • The detailArg parameter of the initUIEventNS method specifies UIEvent.detail.

Text events types

TextEvent

  • The TextEvent interface provides specific contextual information associated with Text Events.
  • To create an instance of the TextEvent interface, use the DocumentEvent.createEvent("TextEvent") method call.
  • The data attribute holds the value of the characters generated by the character device.
  • The data attribute may be a single Unicode character or a non-empty sequence of Unicode characters.
  • The data attribute cannot be null or contain the empty string.
  • The initTextEvent method initializes attributes of a TextEvent object.
  • Invoking the initTextEvent method has the same behavior as UIEvent.initUIEvent().
  • The value of UIEvent.detail remains undefined.
  • The typeArg parameter of the initTextEvent method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initTextEvent method specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initTextEvent method specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
  • The viewArg parameter of the initTextEvent method specifies UIEvent.view.
  • The viewArg parameter of the initTextEvent method may be null.
  • The dataArg parameter of the initTextEvent method specifies TextEvent.data.
  • The initTextEventNS method initializes attributes of a TextEvent object.
  • Invoking the initTextEventNS method has the same behavior as UIEvent.initUIEventNS().
  • The value of UIEvent.detail remains undefined.
  • The namespaceURIArg parameter of the initTextEventNS method specifies Event.namespaceURI, the namespace URI associated with this event.
  • The namespaceURIArg parameter value of the initTextEventNS method may be null if no namespace.
  • The typeArg parameter of the initTextEventNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initTextEventNS method specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initTextEventNS method specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
  • The viewArg parameter of the initTextEventNS method specifies UIEvent.view.
  • The viewArg parameter value of the initTextEventNS method may be null.
  • The dataArg parameter of the initTextEventNS method specifies TextEvent.data.

Keyboard Event Types

KeyboardEvent

  • The KeyboardEvent interface provides specific contextual information associated with keyboard devices.
  • This interface provides convenient attributes for some common modifiers keys: KeyboardEvent.ctrlKey, KeyboardEvent.shiftKey, KeyboardEvent.altKey, KeyboardEvent.metaKey.
  • The attributes mentioned above are equivalent to using the method KeyboardEvent.getModifierState(keyIdentifierArg) with "Control", "Shift", "Alt", or "Meta" respectively.
  • To create an instance of the KeyboardEvent interface, use the DocumentEvent.createEvent("KeyboardEvent") method call.
  • The constants: DOM_KEY_LOCATION LEFT, DOM_KEY_LOCATION_NUMPAD, DOM_KEY_LOCATION_RIGHT and DOM_KEY_LOCATION_STANDARD are used to indicate the location of a key on the device.
  • Different constant values must be used in case a DOM implementation wishes to provide new location information.
  • The DOM_KEY_LOCATION_LEFT constant value indicates that the key activated is in the left key location (there is more than one possible location for this key).
  • The DOM_KEY_LOCATION_NUMPAD constant value indicates that the key activation originated on the numeric keypad or with a virtual key corresponding to the numeric keypad.
  • The DOM_KEY_LOCATION_RIGHT constant indicates The key activation is in the right key location (there is more than one possible location for this key).
  • The DOM_KEY_LOCATION_STANDARD constant indicates that the key activation is not distinguished as the left or right version of the key, and did not originate from the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).
  • The altKey attribute is “true” if the alternative (Alt) key modifier is activated, otherwise the attribute will be “false”.
  • The ctrlKey attribute is “true” if the control (Ctrl) key modifier is activated, otherwise the attribute will be “false”.
  • The keyIdentifier attribute holds the identifier of the key.
  • The keyIdentifier attribute that is unable to identify a key must use the key identifier "Unidentified".
  • The keyLocation attribute contains an indication of the location of the key on the device.
  • The metaKey attribute is “true” if the meta (Meta) key modifier is activated, otherwise the attribute will be “false”.
  • The shiftKey attribute is “true” if the shift (Shift) key modifier is activated, otherwise the attribute will be “false”.
  • The getModifierState method queries the state of a modifier using a key identifier.
  • The getModifierState method will return true if it is a modifier key and the modifier is activated.
  • The getModifierState method will return false if it is not a modifier key or if the modifier is not activated.
  • The keyIdentifierArg parameter of the getModifierState method is a modifier key identifier. Common modifier keys are "Alt", "AltGraph", "CapsLock", "Control", "Meta", "NumLock", "Scroll", or "Shift".
  • The initKeyboardEvent method initializes attributes of a KeyboardEvent object.
  • The typeArg parameter of the initKeyboardEvent method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initKeyboardEvent method specifies Event.bubbles.
  • The canBubbleArg parameter of the initKeyboardEvent method overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initKeyboardEvent method specifies Event.cancelable.
  • The cancelableArg parameter of the initKeyboardEvent method also overrides the intrinsic cancelable behavior of the event.
  • The viewArg parameter of the initKeyboardEvent method specifies UIEvent.view.
  • The viewArg parameter value of the initKeyboardEvent method may be null.
  • The keyIdentifierArg parameter of the initKeyboardEvent method specifies KeyboardEvent.keyIdentifier.
  • The keyLocationArg parameter of the initKeyboardEvent method specifies KeyboardEvent.keyLocation.
  • The modifiersListArg is a white space separated list of modifier key identifiers to be activated on this object.
  • The initKeyboardEventNS initializes attributes of a KeyboardEvent object.
  • The namespaceURIArg parameter of the initKeyboardEventNS method specifies Event.namespaceURI, the namespace URI associated with this event.
  • The namespaceURIArg parameter value of the initKeyboardEventNS method may be null if no namespace.
  • The typeArg parameter of the initKeyboardEventNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initKeyboardEventNS method specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initKeyboardEventNS method specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
  • The viewArg parameter of the initKeyboardEventNS method specifies UIEvent.view.
  • The viewArg parameter value of the initKeyboardEventNS method may be null.
  • The keyIdentifierArg parameter value of the initKeyboardEventNS method specifies KeyboardEvent.keyIdentifier.
  • The keyLocationArg parameter value of the initKeyboardEventNS method specifies KeyboardEvent.keyLocation
  • The modifiersListArg parameter value of the initKeyboardEventNS method is a white space separated list of modifier key identifiers to be activated on this object.

Mouse Event Types

MouseEvent

  • The MouseEvent interface provides specific contextual information associated with Mouse events.
  • To create an instance of the MouseEvent interface, use the DocumentEvent.createEvent("MouseEvent") method call.
  • The getModifierState method queries the state of a modifier using a key identifier.
  • The getModifierState method returns “true” if it is a modifier key and the modifier is activated.
  • The getModifierState method returns “false” if it is not a modifier key or the modifier is not activated.
  • The keyIdentifierArg parameter of the getModifierState method is a modifier key identifier. Common modifier keys are "Alt", "AltGraph", "CapsLock", "Control", "Meta", "NumLock", "Scroll", or "Shift".
  • The initMouseEventNS method initializes attributes of a MouseEvent object.
  • The namespaceURIArg parameter of the initMouseEventNS method specifies Event.namespaceURI, the namespace URI associated with this event, or null if no namespace.
  • The typeArg parameter of the initMouseEventNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initMouseEventNS method specifies Event.bubbles.
  • The canBubbleArg parameter of the initMouseEventNS method also overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initMouseEventNS method specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
  • The viewArg parameter of the initMouseEventNS method specifies UIEvent.view.
  • The viewArg parameter value of the initMouseEventNS method may be null.
  • The detailArg parameter of the initMouseEventNS method specifies UIEvent.detail.
  • The screenXArg parameter of the initMouseEventNS method specifies MouseEvent.screenX.
  • The screenYArg parameter of the initMouseEventNS method specifies MouseEvent.screenY.
  • The clientXArg parameter of the initMouseEventNS method specifies MouseEvent.clientX.
  • The clientYArg parameter of the initMouseEventNS method specifies MouseEvent.clientY.
  • The buttonArg parameter of the initMouseEventNS method specifies MouseEvent.button.
  • The relatedTargetArg parameter of the initMouseEventNS method specifies MouseEvent.relatedTarget.
  • The relatedTargetArg parameter value of the initMouseEventNS method may also be null.
  • The modifiersListArg parameter of the initMouseEventNS method is a white space separated list of modifier key identifiers to be activated on this object.

Mouse Wheel Event Types

MouseWheelEvent

  • The MouseWheelEvent interface provides specific contextual information associated with mouse wheel events.
  • To create an instance of the MouseWheelEvent interface, use the DocumentEvent.createEvent("MouseWheelEvent") method call.
  • The wheelDelta attribute represents the distance the wheel has rotated around the y-axis.
  • The initMouseWheelNS method initializes attributes of a MouseWheelEvent object.
  • The namespaceURIArg parameter of the initMouseWheelNS method specifies Event.namespaceURI, the namespace URI associated with this event.
  • The namespaceURIArg parameter of the initMouseWheelNS method may be null if no namespace is associated with this event.
  • The typeArg parameter of the initMouseWheelNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initMouseWheelNS method specifies Event.bubbles.
  • The canBubbleArg parameter of the initMouseWheelNS method overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initMouseWheelNS method specifies Event.cancelable.
  • The cancelableArg parameter of the initMouseWheelNS method overrides the intrinsic cancelable behavior of the event.
  • The viewArg parameter of the initMouseWheelNS method specifies UIEvent.view.
  • The viewArg parameter value of the initMouseWheelNS method may be null.
  • The detailArg parameter of the initMouseWheelNS method specifies UIEvent.detail.
  • The screenXArg parameter of the initMouseWheelNS method specifies MouseEvent.screenX.
  • The screenYArg parameter of the initMouseWheelNS method specifies MouseEvent.screenY.
  • The clientXArg parameter of the initMouseWheelNS method specifies MouseEvent.clientX.
  • The clientYArg parameter of the initMouseWheelNS method specifies MouseEvent.clientY.
  • The buttonArg parameter of the initMouseWheelNS method specifies MouseEvent.button.
  • The relatedTargetArg parameter of the initMouseWheelNS method specifies MouseEvent.relatedTarget.
  • The relatedTargetArg parameter value of the initMouseWheelNS method may be null.
  • The modifiersArg parameter of the initMouseWheelNS method is a white space separated list of modifier key identifiers to be activated on this object.
  • The wheelDeltaArg parameter of the initMouseWheelNS method specifies MouseWheelEvent.wheelDelta.

Wheel Event Types

Wheel Event

  • The WheelEvent interface provides specific contextual information associated with omnidirectional mouse wheel events.
  • To create an instance of the WheelEvent interface, use the DocumentEvent.createEvent("WheelEvent") method call.
  • The attribute deltaX represents the distance the wheel has rotated around the x-axis.
  • The attribute deltaY represents the distance the wheel has rotated around the y-axis.
  • The attribute deltaZ represents the distance the wheel has rotated around the z-axis.
  • The initWheelEventNS method initializes attributes of a WheelEvent object.
  • The namespaceURIArg parameter of the initWheelEventNS method specifies Event.namespaceURI, the namespace URI associated with this event, or null if no namespace.
  • The typeArg parameter of the initWheelEventNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initWheelEventNS method specifies Event.bubbles.
  • The cancelableArg parameter of the initWheelEventNS method specifies Event.cancelable.
  • The viewArg parameter of the initWheelEventNS method specifies UIEvent.view.
  • The viewArg parameter value of the initWheelEventNS method may be null.
  • The detailArg parameter of the initWheelEventNS method specifies UIEvent.detail.
  • The screenXArg parameter of the initWheelEventNS method specifies MouseEvent.screenX.
  • The screenYArg parameter of the initWheelEventNS method specifies MouseEvent.screenY.
  • The clientXArg parameter of the initWheelEventNS method specifies MouseEvent.clientX.
  • The clientYArg parameter of the initWheelEventNS method specifies MouseEvent.clientY.
  • The buttonArg parameter of the initWheelEventNS method specifies MouseEvent.button.
  • The relatedTargetArg parameter of the initWheelEventNS method specifies MouseEvent.relatedTarget.
  • The relatedTargetArg parameter value of the initWheelEventNS method may be null.
  • The modifiersListArg parameter of the initWheelEventNS method is a white space separated list of modifier key identifiers to be activated on this object.
  • The deltaXArg parameter of the initWheelEventNS method specifies WheelEvent.deltaX.
  • The deltaYArg parameter of the initWheelEventNS method specifies WheelEvent.deltaY.
  • The deltaZArg parameter of the initWheelEventNS method specifies WheelEvent.deltaZ.

Mutation Event Types

MutationEvent

  • The MutationEvent interface provides specific contextual information associated with Mutation events.
  • To create an instance of the MutationEvent interface, use the DocumentEvent.createEvent("MutationEvent") method call.
  • The initMutationEventNS method initializes attributes of a MutationEvent object.
  • The namespaceURIArg parameter of the initMutationEventNS method specifies Event.namespaceURI, the namespace URI associated with this event.
  • The namespaceURIArg parameter value of the initMutationEventNS method may be null if no namespace.
  • The typeArg parameter of the initMutationEventNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initMutationEventNS method specifies Event.bubbles.
  • The cancelableArg parameter of the initMutationEventNS method specifies Event.cancelable.
  • The relatedNodeArg parameter of the initMutationEventNS method specifies MutationEvent.relatedNode.
  • The prevValueArg parameter of the initMutationEventNS method specifies MutationEvent.prevValue.
  • The prevValueArg parameter value of the initMutationEventNS method may be null.
  • The newValueArg parameter of the initMutationEventNS method specifies MutationEvent.newValue.
  • The newValueArg parameter value of the initMutationEventNS method may be null.
  • The attrNameArg parameter of the initMutationEventNS method specifies MutationEvent.attrName.
  • The attrNameArg parameter value of the initMutationEventNS method may be null.
  • The attrChangeArg parameter of the initMutationEventNS method specifies MutationEvent.attrChange.
  • The attrChangeArg parameter value of the initMutationEventNS method may be null.

Mutation Name Event Types

MutationNameEvent

  • The MutationNameEvent interface provides specific contextual information associated with Mutation name event types.
  • To create an instance of the MutationNameEvent interface, use the Document.createEvent("MutationNameEvent") method call.
  • The attribute prevNamespaceURI is the previous value of the relatedNode's namespaceURI.
  • The attribute prevNodeName represents the previous value of the relatedNode's nodeName.
  • The initMutationNameEvent method initializes attributes of a MutationNameEvent object.
  • The typeArg parameter of the initMutationNameEvent method specifies Event.type, the local name of the event type.
  • The typeArg parameter of the initMutationNameEvent method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of theinitMutationNameEvent method specifies Event.bubbles.
  • The cancelableArg parameter of the initMutationNameEvent method specifies Event.cancelable.
  • The relatedNodeArg parameter of the initMutationNameEvent method specifies MutationEvent.relatedNode.
  • The prevNamespaceURI parameter of the initMutationNameEvent method specifies MutationNameEvent.prevNamespaceURI.
  • The prevNamespaceURI parameter value of the initMutationNameEvent method may be null.
  • The prevNodeName parameter of the initMutationNameEvent method specifies MutationNameEvent.prevNodeName.
  • The initMutationNameEventNS method initializes attributes of a MutationNameEvent object.
  • The namespaceURIArg parameter of the initMutationNameEventNS method specifies Event.namespaceURI, the namespace URI associated with this event.
  • The namespaceURIArg parameter value of the initMutationNameEventNS method may be null if no namespace.
  • The typeArg parameter of the initMutationNameEventNS method specifies Event.type, the local name of the event type.
  • The canBubbleArg parameter of the initMutationNameEventNS method specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
  • The cancelableArg parameter of the initMutationNameEventNS method specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
  • The relatedNodeArg parameter of the initMutationNameEventNS method specifies MutationEvent.relatedNode.
  • The prevNamespaceURIArg parameter of the initMutationNameEventNS method specifies MutationEvent.prevValue.
  • The prevNamespaceURIArg parameter value of the initMutationNameEventNS method may be null.
  • The prevNodeNameArg parameter of the initMutationNameEventNS method specifies MutationEvent.newValue.
  • The prevNodeNameArg parameter value of the initMutationNameEventNS method may be null.