Checking in Sources/Docs of DOM Level 2 from :

http://www.w3.org/DOM/DOMTM


git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@225913 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dims committed 2001-06-01 11:15:37 +00:00
1 parent 7d5c881d20
commit 82b88df622
231 files changed
+66110

No files matched your search

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- DocumentEvent interface -->
<interface name="DocumentEvent" id="Events-DocumentEvent" since="DOM Level 2">
<descr>
<p>
The <code>DocumentEvent</code> interface provides a mechanism by
which the user can create an Event of a type supported by the implementation.
It is expected that the <code>DocumentEvent</code> interface will be implemented
on the same object which implements the <code>Document</code> interface in an
implementation which supports the Event model.
</p>
</descr>
<method name="createEvent" id="Events-DocumentEvent-createEvent">
<descr>
<p></p>
</descr>
<parameters>
<param name="eventType" type="DOMString" attr="in">
<descr>
<p>The <code>eventType</code> parameter specifies the type of <code>Event</code> interface
to be created. If the <code>Event</code> interface specified is supported by the implementation
this method will return a new <code>Event</code> of the interface type requested. If the
<code>Event</code> is to be dispatched via the <code>dispatchEvent</code> method the
appropriate event init method must be called after creation in order to initialize
the <code>Event</code>'s values. As an example, a user wishing to synthesize some kind of
<code>UIEvent</code> would call <code>createEvent</code> with the parameter "UIEvents". The
<code>initUIEvent</code> method could then be called on the newly created <code>UIEvent</code>
to set the specific type of UIEvent to be dispatched and set its context information.</p>
<p>The <code>createEvent</code> method is used in creating <code>Event</code>s when it is either
inconvenient or unnecessary for the
user to create an <code>Event</code> themselves. In cases where the implementation provided
<code>Event</code> is insufficient, users may supply their own <code>Event</code>
implementations for use with the <code>dispatchEvent</code> method.</p>
</descr>
</param>
</parameters>
<returns type="Event">
<descr><p>The newly created <code>Event</code></p></descr>
</returns>
<raises>
<exception name="DOMException">
<descr><p>NOT_SUPPORTED_ERR: Raised if the implementation does not support
the type of <code>Event</code> interface requested</p>
</descr>
</exception>
</raises>
</method>
</interface>
+169
View File
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- Event interface -->
<interface name="Event" id="Events-Event" since="DOM Level 2">
<descr>
<p>The <code>Event</code> interface is used to provide contextual information about an event
to the handler processing the event. An object which implements the <code>Event</code> interface
is generally passed as the first parameter to an event handler. More specific
context information is passed to event handlers by deriving additional interfaces from
<code>Event</code> which contain information directly relating to the type of event
they accompany. These derived interfaces are also implemented by the object passed to the
event listener.
</p>
</descr>
<group id="Events-Event-eventPhaseType" name="PhaseType">
<descr><p>An integer indicating which phase of event flow is being processed.</p></descr>
<constant name="CAPTURING_PHASE" type="unsigned short" value="1">
<descr><p>The current event phase is the capturing phase.</p></descr>
</constant>
<constant name="AT_TARGET" type="unsigned short" value="2">
<descr><p>The event is currently being evaluated at the target <code>EventTarget</code>.</p></descr>
</constant>
<constant name="BUBBLING_PHASE" type="unsigned short" value="3">
<descr><p>The current event phase is the bubbling phase.</p></descr>
</constant>
</group>
<attribute type="DOMString" name="type" readonly="yes" id="Events-Event-type">
<descr>
<p>The name of the event (case-insensitive). The name must be an <termref def="dt-XML-name">XML
name</termref>.</p>
</descr>
</attribute>
<attribute type="EventTarget" name="target" readonly="yes" id="Events-Event-target">
<descr>
<p>Used to indicate the <code>EventTarget</code> to which the event
was originally dispatched.
</p>
</descr>
</attribute>
<attribute type="EventTarget" name="currentTarget" readonly="yes" id="Events-Event-currentTarget">
<descr>
<p>Used to indicate the <code>EventTarget</code> whose
<code>EventListeners</code> are currently being processed. This is particularly
useful during capturing and bubbling.
</p>
</descr>
</attribute>
<attribute type="unsigned short" name="eventPhase" readonly="yes" id="Events-Event-eventPhase">
<descr>
<p>Used to indicate which phase of event flow is currently
being evaluated.
</p>
</descr>
</attribute>
<attribute type="boolean" name="bubbles" readonly="yes" id="Events-Event-canBubble">
<descr>
<p>Used to indicate whether or not an event is a bubbling event.
If the event can bubble the value is true, else the value is false.
</p>
</descr>
</attribute>
<attribute type="boolean" name="cancelable" readonly="yes" id="Events-Event-canCancel">
<descr>
<p>Used to indicate whether or not an event can have its default
action prevented. If the default action can be prevented the value is true, else the value is false.
</p>
</descr>
</attribute>
<attribute type="DOMTimeStamp" name="timeStamp" readonly="yes" id="Events-Event-timeStamp">
<descr>
<p>
Used to specify the time (in milliseconds relative
to the epoch) at which the event was created. Due to the fact that some
systems may not provide this information the value of
<code>timeStamp</code> may be not available for all events. When not
available, a value of 0 will be returned. Examples of epoch time are
the time of the system start or 0:0:0 UTC 1st January 1970.
</p>
</descr>
</attribute>
<method name="stopPropagation" id="Events-Event-stopPropagation">
<descr>
<p>The <code>stopPropagation</code> method is used prevent further propagation of an event during
event flow. If this method is called by any <code>EventListener</code> the event will cease
propagating through the tree. The event will complete dispatch to all listeners on the current
<code>EventTarget</code> before event flow stops. This method may be used during any stage of
event flow.</p>
</descr>
<parameters>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
<method name="preventDefault" id="Events-Event-preventDefault">
<descr>
<p>If an event is cancelable, the <code>preventDefault</code> method is used
to signify that the event is to be canceled, meaning any default action normally
taken by the implementation as a result of the event will not occur. If, during any stage of event flow,
the <code>preventDefault</code> method is called the event is canceled.
Any default action associated with the event will not occur. Calling this method
for a non-cancelable event has no effect. Once <code>preventDefault</code> has been
called it will remain in effect throughout the remainder of the event's propagation. This
method may be used during any stage of event flow.
</p>
</descr>
<parameters>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
<method name="initEvent" id="Events-Event-initEvent">
<descr>
<p>The <code>initEvent</code> method is used to initialize the value of an <code>Event</code> created through
the <code>DocumentEvent</code> interface. This method may only be called before the <code>Event</code> has
been dispatched via the <code>dispatchEvent</code> method, though it may be called multiple times during that
phase if necessary. If called multiple times the final invocation takes precedence. If called from a
subclass of <code>Event</code> interface only the values specified in the <code>initEvent</code> method are
modified, all other attributes are left unchanged.</p>
</descr>
<parameters>
<param name="eventTypeArg" type="DOMString" attr="in">
<descr><p>Specifies the event type. This type may be any event type currently
defined in this specification or a new event type.. The string must
be an <termref def="dt-XML-name">XML name</termref>. </p>
<p>Any new event type must not begin with any upper, lower, or mixed case version
of the string "DOM". This prefix is reserved for future DOM event sets. It is also
strongly recommended that third parties adding their own events use their own prefix to avoid
confusion and lessen the probability of conflicts with other new events.</p>
</descr>
</param>
<param name="canBubbleArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event can bubble.</p>
</descr>
</param>
<param name="cancelableArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event's default
action can be prevented.</p>
</descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
</interface>
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- Event interface -->
<interface name="EventCapturer" id="Events-EventCapturer"
since="DOM Level 2">
<descr>
<p>The <code>EventCapturer</code> interface is implemented by <code>Node</code>'s which are
designated as being able to capture events.
</p>
</descr>
<method name="captureEvent" id="Events-EventCapturer-captureEvent">
<descr>
<p>This method is used when a capturing <code>Node</code> wishes to begin
capturing a particular type of event.
</p>
</descr>
<parameters>
<param name="type" type="DOMString" attr="in">
<descr><p>The name of the event to be captured</p></descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
<method name="releaseEvent" id="Events-EventCapturer-releaseEvent">
<descr>
<p>This method is used when a capturing <code>Node</code> wishes to cease
capturing a particular type of event.
</p>
</descr>
<parameters>
<param name="type" type="DOMString" attr="in">
<descr><p>The name of the event to be released</p></descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
<method name="routeEvent" id="Events-EventCapturer-routeEvent">
<descr>
<p>This method is called during the handling of an event by a capturing <code>
Node</code> to continue the event's flow to additional event handlers, or if none
are present, to the event's target.
</p>
</descr>
<parameters>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- Need an exception for when method is called outside of an event listener -->
</raises>
</method>
</interface>
@@ -0,0 +1,34 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- EventException interface -->
<exception id="Events-EventException" name="EventException" since="DOM Level 2">
<descr>
<p>
Event operations may throw an <code>EventException</code> as specified in
their method descriptions.
</p>
</descr>
<component id="Events-EventException-code" name="code">
<typename>unsigned short</typename>
</component>
</exception>
<group id="Events-EventException-EventExceptionCode" name="EventExceptionCode" since="DOM Level 2">
<descr>
<p>
An integer indicating the type of error generated.
</p>
</descr>
<constant name="UNSPECIFIED_EVENT_TYPE_ERR" type="unsigned short" value="0">
<descr>
<p>
If the <code>Event</code>'s type was not specified by initializing the
event before the method was called. Specification of the Event's type
as <code>null</code> or an empty string will also trigger this
exception.
</p>
</descr>
</constant>
</group>
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- Event listener interface -->
<interface id="Events-EventListener" name="EventListener"
since="DOM Level 2">
<descr>
<p>
The <code>EventListener</code> interface is the primary method for
handling events. Users implement the <code>EventListener</code> interface
and register their listener on an <code>EventTarget</code> using the
<code>AddEventListener</code> method. The users should also remove their
<code>EventListener</code> from its <code>EventTarget</code> after they
have completed using the listener.
</p>
<p>
When a <code>Node</code> is copied using the <code>cloneNode</code> method
the <code>EventListener</code>s attached to the source <code>Node</code> are
not attached to the copied <code>Node</code>. If the user wishes the same
<code>EventListener</code>s to be added to the newly created copy the user must add them manually.
</p>
</descr>
<method name="handleEvent" id="Events-EventListener-handleEvent">
<descr>
<p>
This method is called whenever an event occurs of the type for which
the <code> EventListener</code> interface was registered.
</p>
</descr>
<parameters>
<param name="evt" type="Event" attr="in">
<descr>
<p>
The <code>Event</code> contains contextual information about the
event. It also contains the <code>stopPropagation</code> and
<code>preventDefault</code> methods which are used in determining the event's flow and default
action.
</p>
</descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
</interface>
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- Event target interface -->
<interface name="EventTarget" id="Events-EventTarget"
since="DOM Level 2">
<descr>
<p>
The <code>EventTarget</code> interface is implemented by all
<code>Nodes</code> in an implementation which supports the DOM Event
Model. Therefore, this interface can be obtained by using
binding-specific casting methods on an instance of the <code>Node</code>
interface. The interface allows registration and removal of
<code>EventListeners</code> on an <code>EventTarget</code> and dispatch
of events to that <code>EventTarget</code>.</p>
</descr>
<method name="addEventListener" id="Events-EventTarget-addEventListener">
<descr>
<p>This method allows the registration of event listeners on the event target.
If an <code>EventListener</code> is added to an <code>EventTarget</code> while it is
processing an event, it will not be triggered by the current actions but may be
triggered during a later stage of event flow, such as the bubbling phase.
</p>
<p>
If multiple identical <code>EventListener</code>s are registered on the same
<code>EventTarget</code> with the same parameters the duplicate instances are discarded.
They do not cause the <code>EventListener</code> to be called twice and since they are
discarded they do not need to be removed with the <code>removeEventListener</code> method.
</p>
</descr>
<parameters>
<param name="type" type="DOMString" attr="in">
<descr><p>The event type for which the user is registering</p></descr>
</param>
<param name="listener" type="EventListener" attr="in">
<descr><p>The <code>listener</code> parameter takes an interface implemented by
the user which contains the methods to be called when the event occurs.</p></descr>
</param>
<param name="useCapture" type="boolean" attr="in">
<descr><p>If true, <code>useCapture</code> indicates that the user wishes to initiate
capture. After initiating capture, all events of the specified type will be
dispatched to the registered <code>EventListener</code> before being dispatched to any
<code>EventTargets</code> beneath them in the tree. Events which are bubbling upward
through the tree will not trigger an <code>EventListener</code> designated to use
capture.</p>
</descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
<method name="removeEventListener" id="Events-EventTarget-removeEventListener">
<descr>
<p>This method allows the removal of event listeners from the event target. If an
<code>EventListener</code> is removed from an <code>EventTarget</code> while it is
processing an event, it will not be triggered by the current actions. <code>EventListener</code>s
can never be invoked after being removed.</p>
<p>Calling <code>removeEventListener</code> with arguments which do not identify any
currently registered <code>EventListener</code> on the <code>EventTarget</code>
has no effect.</p>
</descr>
<parameters>
<param name="type" type="DOMString" attr="in">
<descr><p>Specifies the event type of the <code>EventListener</code> being removed.
</p>
</descr>
</param>
<param name="listener" type="EventListener" attr="in">
<descr><p>The <code>EventListener</code> parameter indicates the <code>EventListener
</code> to be removed.
</p></descr>
</param>
<param name="useCapture" type="boolean" attr="in">
<descr><p>Specifies whether the <code>EventListener</code> being removed was registered as a
capturing listener or not. If a listener was registered twice, one with capture and one
without, each must be removed separately. Removal of a capturing listener does not
affect a non-capturing version of the same listener, and vice versa.
</p></descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
<method name="dispatchEvent" id="Events-EventTarget-dispatchEvent">
<descr>
<p>This method allows the dispatch of events into the implementations event model. Events
dispatched in this manner will have the same capturing and bubbling behavior as events
dispatched directly by the implementation. The target of the event is the <code>
EventTarget</code> on which <code>dispatchEvent</code> is called.
</p>
</descr>
<parameters>
<param name="evt" type="Event" attr="in">
<descr><p>Specifies the event type, behavior, and contextual information to be used
in processing the event.</p>
</descr>
</param>
</parameters>
<returns type="boolean">
<descr><p>The return value of <code>dispatchEvent</code> indicates whether any of
the listeners which handled the event called <code>preventDefault</code>. If
<code>preventDefault</code> was called the value is false, else the value is true.
</p></descr>
</returns>
<raises>
<exception name="EventException">
<descr><p>UNSPECIFIED_EVENT_TYPE_ERR: Raised if the
<code>Event</code>'s type was not specified by initializing the
event before <code>dispatchEvent</code> was called.
Specification of the <code>Event</code>'s type as
<code>null</code> or an empty string will also trigger this
exception.</p>
</descr>
</exception>
</raises>
</method>
</interface>
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- MouseEvent interface -->
<interface name="MouseEvent" inherits="UIEvent" id="Events-MouseEvent"
since="DOM Level 2">
<descr>
<p>The <code>MouseEvent</code> interface provides specific contextual
information associated with Mouse events.</p>
<p>The <code>detail</code> attribute inherited from <code>UIEvent</code>
indicates the number of times a mouse button has been pressed and
released over the same screen location during a user action. The
attribute value is 1 when the user begins this action and increments by 1
for each full sequence of pressing and releasing. If the user moves the
mouse between the mousedown and mouseup the value will be set to 0,
indicating that no click is occurring.</p>
<p>In the case of nested elements mouse events are always targeted at the
most deeply nested element. Ancestors of the targeted element may use
bubbling to obtain notification of mouse events which occur within its
descendent elements.</p>
</descr>
<attribute type="long" name="screenX" readonly="yes"
id="Events-MouseEvent-screenX">
<descr>
<p>The horizontal coordinate at which the
event occurred relative to the origin of the screen coordinate
system.</p>
</descr>
</attribute>
<attribute type="long" name="screenY" readonly="yes"
id="Events-MouseEvent-screenY">
<descr>
<p>The vertical coordinate at which the
event occurred relative to the origin of the screen coordinate
system.</p>
</descr>
</attribute>
<attribute type="long" name="clientX" readonly="yes"
id="Events-MouseEvent-clientX">
<descr>
<p>The horizontal coordinate at which the
event occurred relative to the DOM implementation's client area.</p>
</descr>
</attribute>
<attribute type="long" name="clientY" readonly="yes"
id="Events-MouseEvent-clientY">
<descr>
<p>The vertical coordinate at which the
event occurred relative to the DOM implementation's client area.</p>
</descr>
</attribute>
<attribute type="boolean" name="ctrlKey" readonly="yes"
id="Events-MouseEvent-ctrlKey">
<descr>
<p>Used to indicate whether the 'ctrl' key was depressed
during the firing of the event.</p>
</descr>
</attribute>
<attribute type="boolean" name="shiftKey" readonly="yes"
id="Events-MouseEvent-shiftKey">
<descr>
<p>Used to indicate whether the 'shift' key was depressed
during the firing of the event.</p>
</descr>
</attribute>
<attribute type="boolean" name="altKey" readonly="yes"
id="Events-MouseEvent-altKey">
<descr>
<p>Used to indicate whether the 'alt' key was depressed
during the firing of the event. On some platforms this key may map to
an alternative key name.</p>
</descr>
</attribute>
<attribute type="boolean" name="metaKey" readonly="yes"
id="Events-MouseEvent-metaKey">
<descr>
<p>Used to indicate whether the 'meta' key was depressed
during the firing of the event. On some platforms this key may map to
an alternative key name.</p>
</descr>
</attribute>
<attribute type="unsigned short" name="button" readonly="yes"
id="Events-MouseEvent-button">
<descr>
<p>During mouse events caused by the depression or release of a mouse
button, <code>button</code> is used to indicate which mouse button
changed state. The values for <code>button</code> range from zero to indicate
the left button of the mouse, one to indicate the middle button if present, and
two to indicate the right button. For mice configured for left handed use in which
the button actions are reversed the values are instead read from right to left.</p>
</descr>
</attribute>
<attribute type="EventTarget" name="relatedTarget" readonly="yes"
id="Events-MouseEvent-relatedTarget">
<descr>
<p>Used to identify a secondary <code>EventTarget</code> related
to a UI event. Currently this attribute is used with the mouseover event to indicate the
<code>EventTarget</code> which the pointing device exited and with the mouseout event to indicate the
<code>EventTarget</code> which the pointing device entered.</p>
</descr>
</attribute>
<method name="initMouseEvent" id="Events-Event-initMouseEvent">
<descr>
<p>The <code>initMouseEvent</code> method is used to initialize the value of a <code>MouseEvent</code> created through
the <code>DocumentEvent</code> interface. This method may only be called before the <code>MouseEvent</code> has
been dispatched via the <code>dispatchEvent</code> method, though it may be called multiple times during that
phase if necessary. If called multiple times, the final invocation takes precedence.</p>
</descr>
<parameters>
<param name="typeArg" type="DOMString" attr="in">
<descr><p>Specifies the event type.</p>
</descr>
</param>
<param name="canBubbleArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event can bubble.</p>
</descr>
</param>
<param name="cancelableArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event's default
action can be prevented.</p>
</descr>
</param>
<param name="viewArg" type="views::AbstractView" attr="in">
<descr><p>Specifies the <code>Event</code>'s
<code>AbstractView</code>.</p>
</descr>
</param>
<param name="detailArg" type="long" attr="in">
<descr><p>Specifies the <code>Event</code>'s mouse click count.</p>
</descr>
</param>
<param name="screenXArg" type="long" attr="in">
<descr><p>Specifies the <code>Event</code>'s screen x coordinate</p>
</descr>
</param>
<param name="screenYArg" type="long" attr="in">
<descr><p>Specifies the <code>Event</code>'s screen y coordinate</p>
</descr>
</param>
<param name="clientXArg" type="long" attr="in">
<descr><p>Specifies the <code>Event</code>'s client x coordinate</p>
</descr>
</param>
<param name="clientYArg" type="long" attr="in">
<descr><p>Specifies the <code>Event</code>'s client y coordinate</p>
</descr>
</param>
<param name="ctrlKeyArg" type="boolean" attr="in">
<descr><p>Specifies whether or not control key was depressed during
the <code>Event</code>.</p>
</descr>
</param>
<param name="altKeyArg" type="boolean" attr="in">
<descr><p>Specifies whether or not alt key was depressed during the
<code>Event</code>.</p>
</descr>
</param>
<param name="shiftKeyArg" type="boolean" attr="in">
<descr><p>Specifies whether or not shift key was depressed during the
<code>Event</code>.</p>
</descr>
</param>
<param name="metaKeyArg" type="boolean" attr="in">
<descr><p>Specifies whether or not meta key was depressed during the
<code>Event</code>.</p>
</descr>
</param>
<param name="buttonArg" type="unsigned short" attr="in">
<descr><p>Specifies the <code>Event</code>'s mouse button.</p>
</descr>
</param>
<param name="relatedTargetArg" type="EventTarget" attr="in">
<descr><p>Specifies the <code>Event</code>'s related <code>EventTarget</code>.</p>
</descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
</interface>
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- MutationEvent interface -->
<interface name="MutationEvent" inherits="Event"
id="Events-MutationEvent" since="DOM Level 2">
<descr>
<p>The <code>MutationEvent</code> interface provides specific contextual
information associated with Mutation events.
</p>
</descr>
<group id="Events-MutationEvent-attrChangeType" name="attrChangeType">
<descr><p>An integer indicating in which way the <code>Attr</code> was changed.</p></descr>
<constant name="MODIFICATION" type="unsigned short" value="1">
<descr><p>The <code>Attr</code> was modified in place.</p></descr>
</constant>
<constant name="ADDITION" type="unsigned short" value="2">
<descr><p>The <code>Attr</code> was just added.</p></descr>
</constant>
<constant name="REMOVAL" type="unsigned short" value="3">
<descr><p>The <code>Attr</code> was just removed.</p></descr>
</constant>
</group>
<attribute type="Node" name="relatedNode" readonly="yes"
id="Events-MutationEvent-relatedNode">
<descr>
<p>
<code>relatedNode</code> is used to identify a secondary node related to a mutation event.
For example, if a mutation event is dispatched to a node indicating that its parent
has changed, the <code>relatedNode</code> is the changed parent. If an event is instead
dispatched to a subtree indicating a node was changed within it, the <code>relatedNode</code>
is the changed node. In the case of the DOMAttrModified event it indicates the <code>Attr</code>
node which was modified, added, or removed.
</p>
</descr>
</attribute>
<attribute type="DOMString" name="prevValue" readonly="yes"
id="Events-MutationEvent-prevValue">
<descr>
<p>
<code>prevValue</code> indicates the previous value of the <code>Attr</code> node in
DOMAttrModified events, and of the <code>CharacterData</code> node in DOMCharDataModified events.
</p>
</descr>
</attribute>
<attribute type="DOMString" name="newValue" readonly="yes"
id="Events-MutationEvent-newValue">
<descr>
<p>
<code>newValue</code> indicates the new value of the <code>Attr</code> node in DOMAttrModified
events, and of the <code>CharacterData</code> node in DOMCharDataModified events.
</p>
</descr>
</attribute>
<attribute type="DOMString" name="attrName" readonly="yes"
id="Events-MutationEvent-attrName">
<descr>
<p>
<code>attrName</code> indicates the name of the changed <code>Attr</code> node in a
DOMAttrModified event.
</p>
</descr>
</attribute>
<attribute type="unsigned short" name="attrChange" readonly="yes"
id="Events-MutationEvent-attrChange">
<descr>
<p>
<code>attrChange</code> indicates the type of change which triggered the DOMAttrModified event.
The values can be <code>MODIFICATION</code>, <code>ADDITION</code>, or <code>REMOVAL</code>.
</p>
</descr>
</attribute>
<method name="initMutationEvent" id="Events-Event-initMutationEvent">
<descr>
<p>The <code>initMutationEvent</code> method is used to initialize the value of a <code>MutationEvent</code> created through
the <code>DocumentEvent</code> interface. This method may only be called before the <code>MutationEvent</code> has
been dispatched via the <code>dispatchEvent</code> method, though it may be called multiple times during that
phase if necessary. If called multiple times, the final invocation takes precedence.</p>
</descr>
<parameters>
<param name="typeArg" type="DOMString" attr="in">
<descr><p>Specifies the event type.</p>
</descr>
</param>
<param name="canBubbleArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event can bubble.</p>
</descr>
</param>
<param name="cancelableArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event's default
action can be prevented.</p>
</descr>
</param>
<param name="relatedNodeArg" type="Node" attr="in">
<descr><p>Specifies the <code>Event</code>'s related Node.</p>
</descr>
</param>
<param name="prevValueArg" type="DOMString" attr="in">
<descr><p>Specifies the <code>Event</code>'s <code>prevValue</code> attribute. This value may be null.</p>
</descr>
</param>
<param name="newValueArg" type="DOMString" attr="in">
<descr><p>Specifies the <code>Event</code>'s <code>newValue</code> attribute. This value may be null.</p>
</descr>
</param>
<param name="attrNameArg" type="DOMString" attr="in">
<descr><p>Specifies the <code>Event</code>'s <code>attrName</code> attribute. This value may be null.</p>
</descr>
</param>
<param name="attrChangeArg" type="unsigned short" attr="in">
<descr><p>Specifies the <code>Event</code>'s <code>attrChange</code> attribute</p>
</descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
</interface>
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<!-- UIEvent interface -->
<interface name="UIEvent" inherits="Event" id="Events-UIEvent"
since="DOM Level 2">
<descr>
<p>The <code>UIEvent</code> interface provides specific contextual
information associated with User Interface events.</p>
</descr>
<attribute type="views::AbstractView" name="view" readonly="yes"
id="Events-UIEvent-view">
<descr>
<p>The <code>view</code> attribute identifies the
<code>AbstractView</code> from which the event was generated.</p>
</descr>
</attribute>
<attribute id="Events-UIEvent-detail" name="detail" type="long" readonly="yes">
<descr><p>Specifies some detail information about the <code>Event</code>,
depending on the type of event.</p>
</descr>
</attribute>
<method name="initUIEvent" id="Events-Event-initUIEvent">
<descr>
<p>The <code>initUIEvent</code> method is used to initialize the value of a <code>UIEvent</code> created through
the <code>DocumentEvent</code> interface. This method may only be called before the <code>UIEvent</code> has
been dispatched via the <code>dispatchEvent</code> method, though it may be called multiple times during that
phase if necessary. If called multiple times, the final invocation takes precedence.</p>
</descr>
<parameters>
<param name="typeArg" type="DOMString" attr="in">
<descr><p>Specifies the event type.</p>
</descr>
</param>
<param name="canBubbleArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event can bubble.</p>
</descr>
</param>
<param name="cancelableArg" type="boolean" attr="in">
<descr><p>Specifies whether or not the event's default
action can be prevented.</p>
</descr>
</param>
<param name="viewArg" type="views::AbstractView" attr="in">
<descr><p>Specifies the <code>Event</code>'s
<code>AbstractView</code>.</p>
</descr>
</param>
<param name="detailArg" type="long" attr="in">
<descr><p>Specifies the <code>Event</code>'s detail.</p>
</descr>
</param>
</parameters>
<returns type="void">
<descr><p></p></descr>
</returns>
<raises>
<!-- No exceptions -->
</raises>
</method>
</interface>
+165
View File
@@ -0,0 +1,165 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<!DOCTYPE spec PUBLIC
"-//W3C//DTD Specification V2.1-Based DOM//EN"
"../../../pubtext/xmlspec-v21-dom.dtd" [
<!ENTITY prefix "Events">
<!ENTITY % version SYSTEM "../version.xml">
%version;
<!ENTITY % links SYSTEM "../link-entities.xml">
%links;
<!ENTITY % parts SYSTEM "../part-entities.xml">
%parts;
<!ENTITY options SYSTEM "../options.xml">
]>
<spec>
<!--
*************************************************************************
* FRONT MATTER *
*************************************************************************
-->
&options;
<header>
<title>Document Object Model (DOM) Level 2 Events Specification</title>
<version>1.0</version> <w3c-designation>&doc.prefix;-&doc.date;
</w3c-designation> <w3c-doctype>W3C Recommendation</w3c-doctype> <pubdate>
<day>&date.day;</day> <month>&date.month;</month> <year>&date.year;</year>
</pubdate>
<publoc> <loc href="&this.url;">&this.url;</loc>
&ps.loc;
&pdf.loc;
&txt.loc;
&zip.loc;
</publoc>
<latestloc> <loc href="&latest.url;">&latest.url;</loc> </latestloc>
<prevlocs>
&prev.locs;
</prevlocs>
<authlist>
<author role="editor"> <name>Tom Pixley</name>
<affiliation>Netscape Communications Corp.</affiliation> </author>
</authlist>
<!--
******************************************************
* DOCUMENT ABSTRACT *
******************************************************
-->
<abstract id="id-abstract">
<p>This specification defines the Document Object Model Level 2 Events, a
platform- and language-neutral interface that gives to programs and scripts a
generic event system. The Document Object Model Level 2 Events builds on the
Document Object Model Level 2 Core <bibref ref='DOMCore'/> and on Document
Object Model Level 2 Views <bibref ref='DOMViews'/>.</p>
</abstract>
&status;
<sourcedesc>
<p>Created in electronic form.</p>
</sourcedesc>
<langusage>
<language id="en">English</language>
</langusage>
<revisiondesc>
<p>$Revision$</p>
</revisiondesc>
<?GENERATE-TOC?>
</header>
<front>
&toc;
&copyright;
</front>
<body>
&events;
</body>
<!--
*************************************************************************
* BACK MATTER *
*************************************************************************
-->
<back>
<div1 role="idl" id="idl">
<head>IDL Definitions</head>
<p>This appendix contains the complete OMG IDL <bibref ref='OMGIDL'/> for
the Level 2 Document Object Model Events definitions.</p>
<p>The IDL files are also available as: <loc
href="idl.zip">&this.url;/idl.zip</loc></p>
<!--
******************************************************
| Events OMG IDL DEFINITIONS |
******************************************************
-->
<?GENERATE-IDL Events events dom.w3c.org dom views?>
</div1>
<div1 role="java-binding" id="java-binding">
<head>Java Language Binding</head>
<p>This appendix contains the complete Java <bibref ref='Java'/> bindings
for the Level 2 Document Object Model Events.</p>
<p>The Java files are also available as <loc
href="java-binding.zip">&this.url;/java-binding.zip</loc></p>
<!--
******************************************************
| Events JAVA BINDINGS |
******************************************************
-->
<?GENERATE-JAVA Events org.w3c.dom events?>
</div1>
<div1 role="ecma-binding" id="ecma-binding">
<head>ECMAScript Language Binding</head>
<p>This appendix contains the complete ECMAScript <bibref
ref='ECMAScript'/> binding for the Level 2 Document Object Model Events
definitions.</p>
<note>
<p>
Exceptions handling is only supported by ECMAScript implementation
conformant with the Standard ECMA-262 3rd. Edition (<bibref
ref="ECMAScript"/>).
</p>
</note>
<!--
******************************************************
| Events ECMASCRIPT BINDINGS |
******************************************************
-->
<?GENERATE-ECMA Events?>
<p>
The following example will add an ECMAScript based EventListener to the
Node 'exampleNode':
</p>
<eg role='code'>
// Given the Node 'exampleNode'
// Define the EventListener function
function clickHandler(evt)
{
// Function contents
}
// The following line will add a non-capturing 'click' listener
// to 'exampleNode'.
exampleNode.addEventListener("click", clickHandler, false);
</eg>
</div1>
&contributors;
&glossary;
&references;
&index;
</back>
</spec>
+825
View File
@@ -0,0 +1,825 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<!--
*************************************************************************
* BEGINNING OF EVENTS *
*************************************************************************
-->
<div1 id="Events">
<head>Document Object Model Events</head>
<orglist role="editors">
<member>
<name>Tom Pixley</name>
<affiliation>Netscape Communications Corp.</affiliation>
</member>
</orglist>
<?GENERATE-MINI-TOC?>
<!--
******************************************************
| INTRODUCTION |
******************************************************
-->
<div2 id="Events-overview">
<head>Overview of the DOM Level 2 Event Model</head>
<p>The DOM Level 2 Event Model is designed with two main goals. The first goal is the design
of a generic event system which allows registration of event handlers, describes event flow
through a tree structure, and provides basic contextual information for each event.
Additionally, the specification will provide standard modules of events for user
interface control and document mutation notifications, including defined contextual information
for each of these event modules.</p>
<p>The second goal of the event model is to provide a common subset of the current event
systems used in <termref def='dt-DOM-Level-0'>DOM
Level 0</termref> browsers. This is
intended to foster interoperability of existing scripts and content. It is not expected that
this goal will be met with full backwards compatibility. However, the specification attempts
to achieve this when possible.</p>
<p>The following sections of the Event Model specification define both the specification
for the DOM Event Model and a number of conformant event modules designed for use within the
model. The Event Model consists of the two sections on event propagation and event listener
registration and the Event interface.</p>
<p>
A DOM application may use the <code>hasFeature(feature, version)</code>
method of the <code>DOMImplementation</code> interface with parameter
values "Events" and "2.0" (respectively) to determine whether or not the
event module is supported by the implementation. In order to fully support this
module, an implementation must also support the "Core" feature defined in
the DOM Level 2 Core specification <bibref ref="DOMCore"/>. Please, refer
to additional information about <xspecref
href='&core.latest.url;/introduction.html#ID-Conformance'>conformance</xspecref>
in the DOM Level 2 Core specification <bibref ref="DOMCore"/>.
</p>
<p>
Each event module describes its own feature string in the event module
listing.
</p>
<div3 id="Events-overview-terminology">
<head>Terminology</head>
<glist>
<gitem>
<label>UI events</label>
<def><p>User interface events. These events are generated
by user interaction through an external device (mouse, keyboard, etc.)</p></def>
</gitem>
<gitem>
<label>UI Logical events</label>
<def><p>Device independent user interface events such as focus change
messages or element triggering notifications.</p></def>
</gitem>
<gitem>
<label>Mutation events</label>
<def><p>Events caused by any action which modifies the structure of the
document.</p></def>
</gitem>
<gitem>
<label>Capturing</label>
<def><p>The process by which an event can be handled by one of the event's
target's <termref def="dt-ancestor">ancestors</termref> before being handled by the event's target.</p></def>
</gitem>
<gitem>
<label>Bubbling</label>
<def><p>The process by which an event propagates upward through its
<termref def="dt-ancestor">ancestors</termref>
after being handled by the event's target.</p></def>
</gitem>
<gitem>
<label>Cancelable</label>
<def><p>A designation for events which indicates that upon handling the event
the client may choose to prevent the DOM implementation from processing any default
action associated with the event.</p></def>
</gitem>
</glist>
</div3>
</div2>
<div2 id="Events-flow">
<head>Description of event flow</head>
<p>Event flow is the process through which the an event originates from the DOM implementation
and is passed into the Document Object Model. The methods of event capture and event
bubbling, along with various event listener registration techniques, allow the event
to then be handled in a number of ways. It can be handled locally at the <code>
EventTarget</code> level or centrally from an <code>EventTarget</code> higher in the document tree.</p>
<div3 id="Events-flow-basic">
<head>Basic event flow</head>
<p>Each event has an <code>EventTarget</code> toward which the event is directed by the DOM implementation. This
<code>EventTarget</code> is specified in the <code>Event</code>'s <code>target</code> attribute. When
the event reaches the target, any event
listeners registered on the <code>EventTarget</code> are triggered. Although all <code>EventListeners</code>
on the <code>EventTarget</code> are guaranteed to be triggered by any event which is received by that <code>
EventTarget</code>, no specification is made as to the order
in which they will receive the event with regards to the other <code>EventListeners</code> on the
<code>EventTarget</code>. If neither event
capture or event bubbling are in use for that particular event,
the event flow process will complete after all listeners have been triggered. If event capture
or event bubbling is in use, the event flow will be modified as described in the sections below.</p>
<p>Any exceptions thrown inside an <code>EventListener</code> will not stop propagation of the
event. It will continue processing any additional <code>EventListener</code> in the described manner.</p>
<p>It is expected that actions taken by <code>EventListener</code>s may cause additional events to
fire. Additional events should be handled in a synchronous manner and may cause reentrancy into
the event model.</p>
</div3>
<div3 id="Events-flow-capture">
<head>Event capture</head>
<p>Event capture is the process by which an EventListener registered on
an <termref def="dt-ancestor">ancestor</termref>
of the event's target can intercept events of a given type before they
are received by the event's target. Capture operates from
the top of the tree, generally the <code>Document</code>, downward, making it the symmetrical opposite of bubbling
which is described below. The chain of <code>EventTarget</code>s from the top of the tree
to the event's target is determined before the initial dispatch of the event. If modifications
occur to the tree during event processing, event flow will proceed based on the initial state of the tree.</p>
<p>An <code>EventListener</code> being registered on an <code>EventTarget</code>
may choose to have that <code>EventListener</code> capture events by
specifying the <code>useCapture</code> parameter of the <code>addEventListener</code>
method to be <code>true</code>. Thereafter, when an event of the given type is
dispatched toward a <termref def="dt-descendant">descendant</termref> of the capturing object, the event
will trigger any capturing event listeners of the appropriate type
which exist in the direct line between the top of the document and the
event's target. This downward propagation continues until the event's target is
reached. A capturing <code>EventListener</code> will not be triggered by events
dispatched directly to the <code>EventTarget</code> upon which it is registered.</p>
<p>If the capturing <code>EventListener</code> wishes to prevent further
processing of the event from occurring it may call the <code>stopProgagation</code> method of
the <code>Event</code> interface. This will prevent further dispatch of the event, although additional <code>EventListeners</code> registered at
the same hierarchy level will still receive the event. Once an event's
<code>stopPropagation</code> method has been called, further calls to that method have
no additional effect. If no additional capturers exist and <code>stopPropagation</code>
has not been called,
the event triggers the appropriate <code>EventListeners</code> on the target
itself.</p>
<p>Although event capture is similar to the delegation based event
model in which all interested parties register their listeners directly on the target
about which they wish to receive notifications, it is different in two important respects.
First, event capture only allows interception of events which are
targeted at <termref def="dt-descendant">descendants</termref>
of the capturing <code>EventTarget</code>. It does not allow interception of events
targeted to the capturer's <termref
def="dt-ancestor">ancestors</termref>, its <termref def="dt-sibling">siblings</termref>, or its
sibling's <termref def="dt-descendant">descendants</termref>. Secondly, event capture is not specified for
a single <code>EventTarget</code>, it is specified for a specific type of event.
Once specified, event capture intercepts all events
of the specified type targeted toward any of the capturer's <termref def="dt-descendant">descendants</termref>.</p>
</div3>
<div3 id="Events-flow-bubbling">
<head>Event bubbling</head>
<p>Events which are designated as bubbling will initially proceed with the
same event flow as non-bubbling events. The event is dispatched to its target
<code>EventTarget</code> and any event listeners found there are triggered. Bubbling
events will then trigger any additional event listeners found by following the
<code>EventTarget</code>'s parent chain upward, checking for any event listeners
registered on each successive <code>EventTarget</code>. This upward propagation will continue
up to and including the <code>Document</code>. <code>EventListener</code>s registered as
capturers will not be triggered during this phase. The chain of <code>EventTarget</code>s from the event
target to the top of the tree is determined before the initial dispatch of the event. If modifications
occur to the tree during event processing, event flow will proceed based on the initial state of the tree.</p>
<p>Any event handler may choose to prevent further event propagation
by calling the <code>stopPropagation</code> method of the <code>Event</code> interface. If
any <code>EventListener</code> calls this method, all additional <code>EventListeners</code>
on the current <code>EventTarget</code> will be triggered but bubbling
will cease at that level. Only one call to <code>stopPropagation</code> is required to
prevent further bubbling.</p>
</div3>
<div3 id="Events-flow-cancelation">
<head>Event cancelation</head>
<p>Some events are specified as cancelable. For these events, the
DOM implementation generally has a default action associated with the
event. An example of this is a hyperlink in a web browser. When the user clicks on the
hyperlink the default action is generally to active that hyperlink.
Before processing these events, the implementation must check for
event listeners registered to receive the event and dispatch the event to
those listeners. These listeners then have the option of canceling the
implementation's 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.</p>
<p>Cancelation is accomplished by calling the <code>Event</code>'s <code>
preventDefault</code> method. If one or more <code>EventListeners</code> call <code>
preventDefault</code> during any phase of event flow the default action will
be canceled.</p>
<p>Different implementations will specify their own default actions, if any, associated
with each event. The DOM does not attempt to specify these actions.</p>
</div3>
</div2>
<div2 id="Events-registration">
<head>Event listener registration</head>
<div3 id="Events-Registration-interfaces">
<head>Event registration interfaces</head>
<definitions>
&events-eventtarget;
&events-eventlistener;
</definitions>
</div3>
<div3 id="Events-registration-html40">
<head>Interaction with HTML 4.0 event listeners</head>
<p>In HTML 4.0, event listeners were specified as attributes of an element. As such,
registration of a second event listener of the same type would replace the
first listener. The DOM Event Model allows registration of multiple event listeners on
a single <code>EventTarget</code>. To achieve this, event listeners are no longer stored as attribute
values.</p>
<p>In order to achieve compatibility with HTML 4.0, implementors may view the setting of
attributes which represent event handlers as the creation and registration of an <code>
EventListener</code> on the <code>EventTarget</code>. The value of <code>useCapture</code>
defaults to <code>false</code>. This <code>EventListener</code> behaves in
the same manner as any other <code>EventListeners</code> which may be registered on the
<code>EventTarget</code>. If the attribute representing the event listener is changed, this may be
viewed as the removal of the previously registered <code>EventListener</code> and the
registration of a new one. No technique is provided to allow HTML 4.0 event listeners
access to the context information defined for each event.</p>
</div3>
</div2>
<div2 id="Events-interface">
<head>Event interface</head>
<definitions>
&events-event;
&events-eventexception;
</definitions>
</div2>
<div2 id="Events-document">
<head>DocumentEvent interface</head>
<definitions>
&events-documentevent;
</definitions>
</div2>
<div2 id="Events-eventgroupings">
<head>Event module definitions</head>
<p>The DOM Level 2 Event Model allows a DOM implementation to support multiple modules of events. The
model has been designed to allow addition of new event modules as is required. The DOM will
not attempt to define all possible events. For purposes of interoperability, the DOM will
define a module of user interface events including lower level device dependent events, a module
of UI logical events, and a module of document mutation events.
Any new event types defined by third parties must not begin with any upper, lower, or mixed
case version of the string "DOM". This prefix is reserved for future DOM event modules. It is also
strongly recommended that third parties adding their own events use their own prefix to avoid
confusion and lessen the probability of conflicts with other new events.
</p>
<div3 id="Events-eventgroupings-uievents">
<head>User Interface event types</head>
<p>The User Interface event module is composed of events listed in HTML 4.0 and additional
events which are supported in <termref def='dt-DOM-Level-0'>DOM
Level 0</termref> browsers.</p>
<p>
A DOM application may use the <code>hasFeature(feature, version)</code>
method of the <code>DOMImplementation</code> interface with parameter
values "UIEvents" and "2.0" (respectively) to determine whether or not
the User Interface event module is supported by the implementation. In
order to fully support this module, an implementation must also support
the "Events" feature defined in this specification and the
"Views" feature defined in the DOM Level 2 Views specification <bibref
ref="DOMViews"/>. Please, refer to additional information about
<xspecref
href='&core.latest.url;/introduction.html#ID-Conformance'>conformance</xspecref>
in the DOM Level 2 Core specification <bibref ref="DOMCore"/>.
</p>
<note>
<p>To create an instance of the <code>UIEvent</code> interface, use the
feature string "UIEvents" as the value of the input parameter used with
the <code>createEvent</code> method of the <code>DocumentEvent</code>
interface.</p>
</note>
<definitions>
&events-uievent;
</definitions>
<p>The different types of such events that can occur are:
<glist>
<gitem>
<label>DOMFocusIn</label>
<def>
<p>The DOMFocusIn event occurs when an <code>EventTarget</code> receives focus, for
instance via a pointing device being moved onto an element or
by tabbing navigation to the element. Unlike the HTML event
focus, DOMFocusIn can be applied to any focusable <code>EventTarget</code>, not just FORM
controls.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMFocusOut</label>
<def>
<p>The DOMFocusOut event occurs when a <code>EventTarget</code> loses focus, for
instance via a pointing device being moved out of an element or
by tabbing navigation out of the element. Unlike the HTML event
blur, DOMFocusOut can be applied to any focusable <code>EventTarget</code>, not just FORM
controls.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMActivate</label>
<def>
<p>The activate event occurs when an element is activated, for
instance, thru a mouse click or a keypress. A numerical
argument is provided to give an indication of the type of
activation that occurs: 1 for a simple activation (e.g. a
simple click or Enter), 2 for hyperactivation (for instance a
double click or Shift Enter).</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: Yes</p></item>
<item><p>Context Info: detail (the numerical value)</p></item>
</ulist>
</def>
</gitem>
</glist>
</p>
</div3>
<div3 id="Events-eventgroupings-mouseevents">
<head>Mouse event types</head>
<p>The Mouse event module is composed of events listed in HTML 4.0 and additional
events which are supported in <termref def='dt-DOM-Level-0'>DOM
Level 0</termref> browsers. This event module is specifically designed for use with mouse
input devices.</p>
<p>
A DOM application may use the <code>hasFeature(feature, version)</code>
method of the <code>DOMImplementation</code> interface with parameter
values "MouseEvents" and "2.0" (respectively) to determine whether or not
the Mouse event module is supported by the implementation. In order to
fully support this module, an implementation must also support the
"UIEvents" feature defined in this specification. Please, refer to
additional information about <xspecref
href='&core.latest.url;/introduction.html#ID-Conformance'>conformance</xspecref>
in the DOM Level 2 Core specification <bibref ref="DOMCore"/>.
</p>
<note>
<p>To create an instance of the <code>MouseEvent</code> interface, use the
feature string "MouseEvents" as the value of the input parameter used with
the <code>createEvent</code> method of the <code>DocumentEvent</code>
interface.</p>
</note>
<definitions>
&events-mouseevent;
</definitions>
<p>The different types of Mouse events that can occur are:
<glist>
<gitem>
<label>click</label>
<def>
<p>The click event occurs when the pointing device button is clicked over
an element. A click is defined as a mousedown and mouseup over the same screen
location. The sequence of these events is:
<eg>
mousedown
mouseup
click
</eg>
If multiple clicks occur at the same screen location, the sequence repeats
with the <code>detail</code> attribute incrementing with each repetition.
This event is valid for most elements.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: Yes</p></item>
<item><p>Context Info: screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, button, detail</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>mousedown</label>
<def>
<p>The mousedown event occurs when the pointing device button is pressed over
an element. This event is valid for most elements.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: Yes</p></item>
<item><p>Context Info: screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, button, detail</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>mouseup</label>
<def>
<p>The mouseup event occurs when the pointing device button is released over
an element. This event is valid for most elements.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: Yes</p></item>
<item><p>Context Info: screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, button, detail</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>mouseover</label>
<def>
<p>The mouseover event occurs when the pointing device is moved onto an element.
This event is valid for most elements.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: Yes</p></item>
<item><p>Context Info: screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, relatedTarget
indicates the <code>EventTarget</code> the pointing device is exiting.</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>mousemove</label>
<def>
<p>The mousemove event occurs when the pointing device is moved while it is
over an element. This event is valid for most elements.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>mouseout</label>
<def>
<p>The mouseout event occurs when the pointing device is moved away from an
element. This event is valid for most elements..</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: Yes</p></item>
<item><p>Context Info: screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, relatedTarget
indicates the <code>EventTarget</code> the pointing device is entering.</p></item>
</ulist>
</def>
</gitem>
</glist>
</p>
</div3>
<div3 id="Events-eventgroupings-keyevents">
<head>Key events</head>
<p>The DOM Level 2 Event specification does not provide a key event module. An event module designed
for use with keyboard
input devices will be included in a later version of the DOM specification.</p>
</div3>
<div3 id="Events-eventgroupings-mutationevents">
<head>Mutation event types</head>
<p>The mutation event module is designed to allow notification of any changes
to the structure of a document, including attr and text modifications. It may
be noted that none of the mutation events listed are designated as cancelable.
This stems from the fact that it is very difficult to make
use of existing DOM interfaces which cause document modifications if any change
to the document might or might not take place due to cancelation of the related
event. Although this is still a desired capability, it was decided that it would
be better left until the addition of transactions into the DOM.</p>
<p>Many single modifications of the tree can cause multiple mutation events to be fired.
Rather than attempt to specify the ordering of mutation events due to every
possible modification of the tree, the ordering of these events is left to the implementation.</p>
<p>
A DOM application may use the <code>hasFeature(feature, version)</code>
method of the <code>DOMImplementation</code> interface with parameter
values "MutationEvents" and "2.0" (respectively) to determine whether or not
the Mutation event module is supported by the implementation. In order to
fully support this module, an implementation must also support the
"Events" feature defined in this specification. Please, refer to
additional information about <xspecref
href='&core.latest.url;/introduction.html#ID-Conformance'>conformance</xspecref>
in the DOM Level 2 Core specification <bibref ref="DOMCore"/>.
</p>
<note>
<p>To create an instance of the <code>MutationEvent</code> interface, use the
feature string "MutationEvents" as the value of the input parameter used with
the <code>createEvent</code> method of the <code>DocumentEvent</code>
interface.</p>
</note>
<definitions>
&events-mutationevent;
</definitions>
<p>The different types of Mutation events that can occur are:
<glist>
<gitem>
<label>DOMSubtreeModified</label>
<def>
<p> This is a general event for notification of all changes to the
document. It can be used instead of the more specific events listed
below. It may be fired after a single modification to the document or, at
the implementation's discretion, after multiple changes have occurred. The
latter use should generally be used to accomodate multiple changes which occur
either simultaneously or in rapid succession. The target of this event
is the lowest common parent of the changes which have taken place. This
event is dispatched after any other events caused by the mutation have
fired.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMNodeInserted</label>
<def>
<p>Fired when a node has been added as a <termref def='dt-child'>child</termref> of another node. This
event is dispatched after the insertion has taken place. The target of
this event is the node being inserted.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: relatedNode holds the parent node</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMNodeRemoved</label>
<def>
<p>Fired when a node is being removed from its parent node. This event is
dispatched before the node is removed from the tree. The target of this
event is the node being removed.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: relatedNode holds the parent node</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMNodeRemovedFromDocument</label>
<def>
<p>Fired when a node is being removed from a document, either through
direct removal of the Node or removal of a subtree in which it is
contained. This event is dispatched before the removal takes place.
The target of this event is the Node being removed. If the Node is
being directly removed the DOMNodeRemoved event will fire before the
DOMNodeRemovedFromDocument event.</p>
<ulist>
<item><p>Bubbles: No</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMNodeInsertedIntoDocument</label>
<def>
<p>Fired when a node is being inserted into a document, either through
direct insertion of the Node or insertion of a subtree in which it is
contained. This event is dispatched after the insertion has taken
place. The target of this event is the node being inserted. If the
Node is being directly inserted the DOMNodeInserted event will fire before
the DOMNodeInsertedIntoDocument event.</p>
<ulist>
<item><p>Bubbles: No</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMAttrModified</label>
<def>
<p>Fired after an <code>Attr</code> has been modified on a node. The target of this
event is the <code>Node</code> whose <code>Attr</code> changed. The value of attrChange indicates
whether the <code>Attr</code> was modified, added, or removed. The
value of relatedNode indicates the <code>Attr</code> node whose value has been affected. It is expected
that string based replacement of an <code>Attr</code> value will be viewed as a modification of the <code>Attr</code>
since its identity does not change. Subsequently replacement of the <code>Attr</code> node with a different
<code>Attr</code> node is viewed as the removal of the first <code>Attr</code> node and the addition of the second.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: attrName, attrChange, prevValue, newValue, relatedNode</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>DOMCharacterDataModified</label>
<def>
<p>Fired after CharacterData within a node has been modified but the node
itself has not been inserted or deleted. This event is also triggered by
modifications to PI elements. The target of this event is the
CharacterData node.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: prevValue, newValue</p></item>
</ulist>
</def>
</gitem>
</glist>
</p>
</div3>
<div3 id="Events-eventgroupings-htmlevents">
<head>HTML event types</head>
<p>The HTML event module is composed of events listed in HTML 4.0 and additional
events which are supported in <termref def='dt-DOM-Level-0'>DOM
Level 0</termref> browsers.</p>
<p>
A DOM application may use the <code>hasFeature(feature, version)</code>
method of the <code>DOMImplementation</code> interface with parameter
values "HTMLEvents" and "2.0" (respectively) to determine whether or not
the HTML event module is supported by the implementation. In order to
fully support this module, an implementation must also support the
"Events" feature defined in this specification. Please, refer to
additional information about <xspecref
href='&core.latest.url;/introduction.html#ID-Conformance'>conformance</xspecref>
in the DOM Level 2 Core specification <bibref ref="DOMCore"/>.
</p>
<note>
<p>To create an instance of the <code>Event</code> interface for
the HTML event module, use the
feature string "HTMLEvents" as the value of the input parameter used with
the <code>createEvent</code> method of the <code>DocumentEvent</code>
interface.</p>
</note>
<p>The HTML events use the base DOM Event interface to pass contextual information.</p>
<p>The different types of such events that can occur are:
<glist>
<gitem>
<label>load</label>
<def>
<p>The load event occurs when the DOM implementation finishes loading all content within
a document, all frames within a FRAMESET, or an OBJECT element.</p>
<ulist>
<item><p>Bubbles: No</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>unload</label>
<def><p>The unload event occurs when the DOM implementation removes a document from a window
or frame. This event is valid for BODY and FRAMESET elements.</p>
<ulist>
<item><p>Bubbles: No</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>abort</label>
<def><p>The abort event occurs when page loading is stopped before an image has
been allowed to completely load. This event applies to OBJECT elements.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>error</label>
<def><p>The error event occurs when an image does not load properly or when an
error occurs during script execution. This event is valid for OBJECT
elements, BODY elements, and FRAMESET element.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>select</label>
<def><p>The select event occurs when a user selects some text in a text field.
This event is valid for INPUT and TEXTAREA elements.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>change</label>
<def><p>The change event occurs when a control loses the input focus and its value
has been modified since gaining focus. This event is valid for INPUT, SELECT, and TEXTAREA.
element.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>submit</label>
<def><p>The submit event occurs when a form is submitted. This event only applies to the
FORM element.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: Yes</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>reset</label>
<def><p>The reset event occurs when a form is reset. This event only applies to the FORM
element.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>focus</label>
<def><p>The focus event occurs when an element receives focus either via a pointing
device or by tabbing navigation. This event is valid for the following
elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.</p>
<ulist>
<item><p>Bubbles: No</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>blur</label>
<def><p>The blur event occurs when an element loses focus either via the pointing
device or by tabbing navigation. This event is valid for the following
elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.</p>
<ulist>
<item><p>Bubbles: No</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>resize</label>
<def>
<p>The resize event occurs when a document view is resized.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
<gitem>
<label>scroll</label>
<def>
<p>The scroll event occurs when a document view is
scrolled.</p>
<ulist>
<item><p>Bubbles: Yes</p></item>
<item><p>Cancelable: No</p></item>
<item><p>Context Info: None</p></item>
</ulist>
</def>
</gitem>
</glist>
</p>
</div3>
</div2>
</div1>
<!--
*************************************************************************
* END OF EVENTS *
*************************************************************************
-->