diff --git a/images/event-inheritance.svg b/images/event-inheritance.svg index a09c6ae..2559c57 100644 --- a/images/event-inheritance.svg +++ b/images/event-inheritance.svg @@ -51,7 +51,7 @@ Event is the base interface. - UIEvent, CustomEvent, and MutationEvent inherit from Event. + UIEvent and CustomEvent inherit from Event. FocusEvent, MouseEvent, KeyboardEvent, and CompositionEvent inherit from UIEvent. WheelEvent inherits from MouseEvent. diff --git a/index-snapshot.html b/index-snapshot.html index 76a53f7..684f6be 100644 --- a/index-snapshot.html +++ b/index-snapshot.html @@ -1187,7 +1187,7 @@

Event Types

The model has been designed to allow addition of new event modules in the future. This document does not attempt to define all possible events. For purposes of interoperability, the DOM defines a module of user interface events - including lower level device dependent events and a module of document mutation events. + including lower level device dependent events.

@@ -7639,8 +7639,8 @@

Legacy Event Initializers

-

Initializing all the attributes of a MutationEvent requires calls to two initializer methods: - initEvent and initMutationEvent. +

Initializing all the attributes of a UIEvent requires calls to two initializer methods: + initEvent and initUIEvent.

@@ -8328,24 +8328,6 @@

Legacy Event Types

Yes None - - DOMAttrModified - Sync - Yes - Element - MutationEvent - No - None - - - DOMCharacterDataModified - Sync - Yes - Text, Comment, ProcessingInstruction - MutationEvent - No - None - DOMFocusIn Sync @@ -8364,56 +8346,6 @@

Legacy Event Types

No None - - DOMNodeInserted - Sync - Yes - Element, Attr, Text, Comment, DocumentType, - ProcessingInstruction - MutationEvent - No - None - - - DOMNodeInsertedIntoDocument - Sync - No - Element, Attr, Text, Comment, DocumentType, - ProcessingInstruction - MutationEvent - No - None - - - DOMNodeRemoved - Sync - Yes - Element, Attr, Text, Comment, DocumentType, - ProcessingInstruction - MutationEvent - No - None - - - DOMNodeRemovedFromDocument - Sync - No - Element, Attr, Text, Comment, DocumentType, - ProcessingInstruction - MutationEvent - No - None - - - DOMSubtreeModified - Sync - Yes - Window, Document, DocumentFragment, Element, Attr - - MutationEvent - No - None - keypress Sync @@ -9051,759 +8983,6 @@

keypress e

-
-

Legacy MutationEvent events

- -

The mutation and mutation name event modules are designed to allow notification of any - changes to the structure of a document, including attribute, text, or name modifications. -

- -

Note: - None of the event types associated with the MutationEvent interface 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 resulting 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. -

- -

Many single modifications of the tree can cause multiple mutation events to be dispatched. - 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. -

- -
-

Warning!

-

The MutationEvent interface was introduced in - DOM Level 2 Events, but has not yet been completely and interoperably implemented across - user agents. - In addition, there have been critiques that the interface, as designed, introduces a - performance and implementation challenge. -

-

DOM4 [DOM4] provides a new mechanism using a - MutationObserver interface which addresses the use cases that mutation events - solve, but in a more performant manner. - Thus, this specification describes mutation events for reference and completeness of legacy - behavior, but deprecates the use of the - MutationEvent interface. -

-
- -
-

Interface MutationEvent

- -

Introduced in DOM Level 2, deprecated in this specification

- -

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. -

- -
-
// attrChangeType
- -
const unsigned short MODIFICATION = 1
-
-

The Attr was modified in place.

-
- -
const unsigned short ADDITION = 2
-
-

The Attr was just added.

-
- -
const unsigned short REMOVAL = 3
-
-

The Attr was just removed.

-
- -
readonly attribute Node? relatedNode
-
-

relatedNode MUST be 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 relatedNode will be the changed parent. - If an event is instead dispatched to a subtree indicating a node was changed - within it, the relatedNode MUST be the changed node. - In the case of the - DOMAttrModified - event, it indicates the Attr node which was modified, added, or removed. -

- -

The un-initialized value of - this attribute MUST be null. -

-
- -
readonly attribute DOMString prevValue
-
-

prevValue indicates the previous value of the Attr node - in DOMAttrModified - events, and of the CharacterData node in - DOMCharacterDataModified - events. -

- -

The un-initialized value of this - attribute MUST be "" (the empty string). -

-
- -
readonly attribute DOMString newValue
-
-

newValue indicates the new value of the Attr node in - DOMAttrModified - events, and of the CharacterData node in - DOMCharacterDataModified - events. -

- -

The un-initialized value of this - attribute MUST be "" (the empty string). -

-
- -
readonly attribute DOMString attrName
-
-

attrName indicates the name of the changed Attr node in - a DOMAttrModified - event. -

- -

The un-initialized value of this - attribute MUST be "" (the empty string). -

-
- -
readonly attribute unsigned short attrChange
-
-

attrChange indicates the type of change which triggered the - DOMAttrModified - event. The values can be MODIFICATION, ADDITION, - or REMOVAL. -

- -

The un-initialized value of this - attribute MUST be 0. -

- -

Note: - There is no defined constant for the attrChange value of 0 (the un-initialized value). -

-
- -
void initMutationEvent()
-
-

Initializes attributes of a MutationEvent object. - This method has the same behavior as Event.initEvent(). -

- -
-
DOMString typeArg
-
-

Refer to the Event.initEvent() method for a description of this parameter.

-
- -
boolean bubblesArg
-
-

Refer to the Event.initEvent() method for a description of this parameter.

-
- -
boolean cancelableArg
-
-

Refer to the Event.initEvent() method for a description of this parameter.

-
- -
Node? relatedNodeArg
-
-

Specifies MutationEvent.relatedNode.

-
- -
DOMString prevValueArg
-
-

Specifies MutationEvent.prevValue. - This value MAY be the empty string. -

-
- -
DOMString newValueArg
-
-

Specifies MutationEvent.newValue. - This value MAY be the empty string. -

-
- -
DOMString attrNameArg
-
-

Specifies MutationEvent.attrName. - This value MAY be the empty string. -

-
- -
unsigned short attrChangeArg
-
-

Specifies MutationEvent.attrChange. - This value MAY be 0. -

-
- -
-
- -
-
- -

The mutation event types are listed below.

- - -
-
-
DOMAttrModified
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMAttrModified
InterfaceMutationEvent
Sync / AsyncSync
BubblesYes
Trusted TargetsElement
CancelableNo
Default actionNone
Context
(trusted events)
- -
- -

A user agent MUST dispatch this event after - an Attr.value has been modified and after an Attr node has been - added to or removed from an Element. - The event target of this event MUST be - the Element node where the change occurred. - It is implementation dependent whether this event type occurs when the children of the - Attr node are changed in ways that do not affect the value of Attr.value. -

- -

Warning! - The DOMAttrModified - event type is defined in this specification for reference and completeness, but this - specification deprecates the use of this event type. -

-
-
-
- - -
-
-
DOMCharacterDataModified
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMCharacterDataModified
InterfaceMutationEvent
Sync / AsyncSync
BubblesYes
Trusted TargetsText, Comment, ProcessingInstruction
CancelableNo
Default actionNone
Context
(trusted events)
- -
- -

A user agent MUST dispatch this event - after CharacterData.data or ProcessingInstruction.data - have been modified, but the node itself has not been inserted or deleted. - The event target of this event MUST - be the CharacterData node or the ProcessingInstruction node. -

- -

Warning! - The DOMCharacterDataModified - event type is defined in this specification for reference and completeness, but this specification - deprecates the use of this event type. -

-
-
-
- - -
-
-
DOMNodeInserted
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeInserted
InterfaceMutationEvent
Sync / AsyncSync
BubblesYes
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
Default actionNone
Context
(trusted events)
- -
- -

A user agent MUST dispatch this event type when - a node other than an Attr node has been added as a child of another node. - A user agent MAY dispatch this event when - an Attr node has been added to an Element node - (see note below). - This event MUST be dispatched after the insertion has taken place. - The event target of this event MUST be the - node being inserted. -

- -

Note: - For detecting attribute insertion, use the - DOMAttrModified - event type instead. -

- -

Warning! - The DOMNodeInserted event - type is defined in this specification for reference and completeness, but this specification - deprecates the use of this event type. -

-
-
-
- - -
-
-
DOMNodeInsertedIntoDocument
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeInsertedIntoDocument
InterfaceMutationEvent
Sync / AsyncSync
BubblesNo
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
Default actionNone
Context
(trusted events)
- -
- -

A user agent MUST dispatch this event when a node - has been inserted into a document, either through direct insertion of the node or insertion of a - subtree in which it is contained. - A user agent MAY treat an Attr - node as part of an Element's subtree. - This event MUST be dispatched after the insertion has taken place. - The event target of this event MUST be the node - being inserted. - If the node is being directly inserted, the event type - DOMNodeInserted - MUST occur before this event type. -

- -

Warning! - The DOMNodeInsertedIntoDocument - event type is defined in this specification for reference and completeness, but this specification - deprecates the use of this event type. -

-
-
-
- - -
-
-
DOMNodeRemoved
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeRemoved
InterfaceMutationEvent
Sync / AsyncSync
BubblesYes
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
Default actionNone
Context
(trusted events)
- -
- -

A user agent MUST dispatch this event when a node - other than an Attr node is being removed from its parent node. - A user agent MAY dispatch this event when an - Attr node is being removed from its ownerElement - (see note below). - This event MUST be dispatched before the removal takes place. The - event target of this event MUST be the node being removed. -

- -

Note: - For reliably detecting attribute removal, use the - DOMAttrModified - event type instead. -

- -

Warning! - The DOMNodeRemoved event type - is defined in this specification for reference and completeness, but this specification - deprecates the use of this event type. -

-
-
-
- - -
-
-
DOMNodeRemovedFromDocument
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeRemovedFromDocument
InterfaceMutationEvent
Sync / AsyncSync
BubblesNo
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
Default actionNone
Context
(trusted events)
- -
- -

A user agent MUST dispatch this event 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. - A user agent MAY treat an Attr - node as part of an Element's subtree. - This event MUST be dispatched before the removal takes place. - The event target of this event type MUST be the node - being removed. - If the node is being directly removed, the event type - DOMNodeRemoved - MUST occur before this event type. -

- -

Note: - For reliably detecting attribute removal, use the - DOMAttrModified - event type instead. -

- -

Warning! - The DOMNodeRemovedFromDocument - event type is defined in this specification for reference and completeness, but this specification - deprecates the use of this event type. -

-
-
-
- - -
-
-
DOMSubtreeModified
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMSubtreeModified
InterfaceMutationEvent
Sync / AsyncSync
BubblesYes
Trusted TargetsWindow, Document, DocumentFragment, Element, Attr -
CancelableNo
Default actionNone
Context
(trusted events)
- -
- -

This is a general event for notification of all changes to the document. - It can be used instead of the more specific mutation and mutation name events. - It MAY be dispatched after a single modification to the document or, at the implementation's - discretion, after multiple changes have occurred. - The latter case SHOULD generally be used to accommodate multiple changes which occur either - simultaneously or in rapid succession. - The target of this event MUST be the lowest common parent of the changes which have taken place. - This event MUST be dispatched after any other events caused by the mutation(s) have occurred. -

- -

Warning! - The DOMSubtreeModified event - type is defined in this specification for reference and completeness, but this specification - deprecates the use of this event type. -

-
-
-
- -
- diff --git a/sections/legacy-event-initializers.txt b/sections/legacy-event-initializers.txt index 8545fa7..6cfd2a7 100644 --- a/sections/legacy-event-initializers.txt +++ b/sections/legacy-event-initializers.txt @@ -14,9 +14,9 @@ derived from the basic {{Event}} interface required that the initializer of fully initialize an event.
-Initializing all the attributes of a MutationEvent requires calls to two +Initializing all the attributes of a UIEvent requires calls to two initializer methods: initEvent and -initMutationEvent. +initUIEvent.
Due in part to the length of time in the development of this standard, some diff --git a/sections/legacy-event-types.txt b/sections/legacy-event-types.txt index e3ba552..8efe1b0 100644 --- a/sections/legacy-event-types.txt +++ b/sections/legacy-event-types.txt @@ -20,34 +20,10 @@ completeness. | | Async | Phase | target types | | | | | +-----------------------------+----o---+----o-----+--------------------o---------------------+--------o---------+------o-----+------o----+------------------------------------------------+ +| DOMActivate | Sync | Yes | Element | UIEvent | Yes | Yes | None | -+| DOMAttrModified | Sync | Yes | Element | MutationEvent | No | No | None | -+| DOMCharacterDataModified | Sync | Yes | Text, | MutationEvent | No | No | None | - | | | | Comment, | | | | | - | | | | ProcessingInstruction | | | | | +| DOMFocusIn | Sync | Yes | Window, | FocusEvent | No | Yes | None | | | | | Element | | | | | +| DOMFocusOut | Sync | Yes | Window, | FocusEvent | No | Yes | None | | | | | Element | | | | | -+| DOMNodeInserted | Sync | Yes | Element, Attr, | MutationEvent | No | No | None | - | | | | Text, Comment, | | | | | - | | | | DocumentType, | | | | | - | | | | ProcessingInstruction | | | | | -+| DOMNodeInsertedIntoDocument | Sync | No | Element, Attr, | MutationEvent | No | No | None | - | | | | Text, Comment, | | | | | - | | | | DocumentType, | | | | | - | | | | ProcessingInstruction | | | | | -+| DOMNodeRemoved | Sync | Yes | Element, Attr, | MutationEvent | No | No | None | - | | | | Text, Comment, | | | | | - | | | | DocumentType, | | | | | - | | | | ProcessingInstruction | | | | | -+| DOMNodeRemovedFromDocument | Sync | No | Element, Attr, | MutationEvent | No | No | None | - | | | | Text, Comment, | | | | | - | | | | DocumentType, | | | | | - | | | | ProcessingInstruction | | | | | -+| DOMSubtreeModified | Sync | Yes | Window, | MutationEvent | No | No | None | - | | | | Document, | | | | | - | | | | DocumentFragment, | | | | | - | | | | Element, Attr | | | | | +| keypress | Sync | Yes | Element | KeyboardEvent | Yes | Yes | Varies: launch text composition system; | | | | | | | | | EVENT{blur} and EVENT{focus} events; | | | | | | | | | EVENT{DOMActivate} event; other event | @@ -533,731 +509,4 @@ interface TextEvent : UIEvent { Issue: See Text Event section in UI Events Algorithms for the {{TextEvent}} interface and the textInput event. - -

Legacy {{MutationEvent}} events

- - The mutation and mutation name event modules are designed to allow - notification of any changes to the structure of a document, including - attribute, text, or name modifications. - -

- None of the event types associated with the {{MutationEvent}} interface 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 resulting 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. -

- - Many single modifications of the tree can cause multiple mutation events to - be dispatched. 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. - -
-

- The {{MutationEvent}} interface was introduced in DOM Level 2 Events, but - has not yet been completely and interoperably implemented across user - agents. In addition, there have been critiques that the interface, as - designed, introduces a performance and implementation challenge. -

-

- DOM4 [[!DOM]] provides a new mechanism using a - MutationObserver interface which addresses the use cases that - mutation events solve, but in a more performant manner. Thus, this - specification describes mutation events for reference and completeness of - legacy behavior, but deprecates the use of the {{MutationEvent}} - interface. -

-
- -

Interface MutationEvent

- -

Introduced in DOM Level 2, deprecated in this - specification

- - The MutationEvent interface provides specific contextual - information associated with Mutation events. - - To create an instance of the MutationEvent interface, use - the {{Document/createEvent()}} method call. - -
-		[Exposed=Window]
-		interface MutationEvent : Event {
-			// attrChangeType
-			const unsigned short MODIFICATION = 1;
-			const unsigned short ADDITION = 2;
-			const unsigned short REMOVAL = 3;
-
-			readonly attribute Node? relatedNode;
-			readonly attribute DOMString prevValue;
-			readonly attribute DOMString newValue;
-			readonly attribute DOMString attrName;
-			readonly attribute unsigned short attrChange;
-
-			undefined initMutationEvent(DOMString typeArg,
-				optional boolean bubblesArg = false,
-				optional boolean cancelableArg = false,
-				optional Node? relatedNodeArg = null,
-				optional DOMString prevValueArg = "",
-				optional DOMString newValueArg = "",
-				optional DOMString attrNameArg = "",
-				optional unsigned short attrChangeArg = 0);
-		};
-		
- -
-
MODIFICATION
-
- The Attr was modified in place. -
- -
ADDITION
-
- The Attr was just added. -
- -
REMOVAL
-
- The Attr was just removed. -
- -
relatedNode
-
- relatedNode MUST be 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 relatedNode will be the changed - parent. If an event is instead dispatched to a subtree - indicating a node was changed within it, the - relatedNode MUST be the changed node. In the case - of the EVENT{DOMAttrModified} event, it indicates the - Attr node which was modified, added, or removed. - - The un-initialized value of this attribute MUST be - null. -
- -
prevValue
-
- prevValue indicates the previous value of the - Attr node in EVENT{DOMAttrModified} events, and of - the CharacterData node in - EVENT{DOMCharacterDataModified} events. - - The un-initialized value of this attribute MUST be - "" (the empty string). -
- -
newValue
-
- newValue indicates the new value of the - Attr node in EVENT{DOMAttrModified} events, and of - the CharacterData node in - EVENT{DOMCharacterDataModified} events. - - The un-initialized value of this attribute MUST be - "" (the empty string). -
- -
attrName
-
- attrName indicates the name of the changed - Attr node in a EVENT{DOMAttrModified} event. - - The un-initialized value of this attribute MUST be - "" (the empty string). -
- -
attrChange
-
- attrChange indicates the type of change which - triggered the EVENT{DOMAttrModified} event. The values can be - MODIFICATION, ADDITION, or - REMOVAL. - - The un-initialized value of this attribute MUST be - 0. - -

- There is no defined constant for the attrChange value of 0 (the - un-initialized value). -

-
- -
initMutationEvent(typeArg)
-
- Initializes attributes of a MutationEvent object. - This method has the same behavior as {{Event/initEvent()}}. - -
-
DOMString typeArg
-
- Refer to the {{Event/initEvent()}} method for a description of this parameter. -
- -
boolean bubblesArg
-
- Refer to the {{Event/initEvent()}} method for a description of this parameter. -
- -
boolean cancelableArg
-
- Refer to the {{Event/initEvent()}} method for a description of this parameter. -
- -
Node? relatedNodeArg
-
- Specifies {{MutationEvent}}.relatedNode. -
- -
DOMString prevValueArg
-
- Specifies {{MutationEvent}}.prevValue. This value MAY be the empty string. -
- -
DOMString newValueArg
-
- Specifies {{MutationEvent}}.newValue. - This value MAY be the empty string. -
- -
DOMString attrNameArg
-
- Specifies {{MutationEvent}}.attrName. - This value MAY be the empty string. -
- -
unsigned short attrChangeArg
-
- Specifies {{MutationEvent}}.attrChange. - This value MAY be 0. -
-
-
-
- -

Legacy {{MutationEvent}} event types

- - The mutation event types are listed below. - -
DOMAttrModified
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMAttrModified
Interface{{MutationEvent}}
Sync / AsyncSync
BubblesYes
Trusted TargetsElement
CancelableNo
ComposedNo
Default actionNone
Context
(trusted events)
-
    -
  • {{Event}}.{{Event/target}} : - element whose attribute is being modified
  • -
  • {{MutationEvent}}.attrName : - the name of the changed Attr node
  • -
  • {{MutationEvent}}.attrChange : - the numerical code corresponding to the most applicable attrChangeType
  • -
  • {{MutationEvent}}.relatedNode : - the Attr node that has been modified, added, or removed.
  • -
  • {{MutationEvent}}.newValue : - new value of the attribute, if the Attr node has been added or modified
  • -
  • {{MutationEvent}}.prevValue : - previous value of the attribute, if the Attr node has been removed or modified
  • -
-
- - A user agent MUST dispatch this event after an - Attr.value has been modified and after an - Attr node has been added to or removed from an - Element. The event target of this event MUST be - the Element node where the change occurred. It is - implementation dependent whether this event type occurs when the - children of the Attr node are changed in ways that do - not affect the value of Attr.value. - -

- The EVENT{DOMAttrModified} event type is defined in this - specification for reference and completeness, but this specification - deprecates the use of this event type. -

- -
DOMCharacterDataModified
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMCharacterDataModified
Interface{{MutationEvent}}
Sync / AsyncSync
BubblesYes
Trusted TargetsText, Comment, ProcessingInstruction
CancelableNo
ComposedNo
Default actionNone
Context
(trusted events)
-
    -
  • {{Event}}.{{Event/target}} : - object whose content is being modified
  • -
  • {{MutationEvent}}.attrName : - the empty string
  • -
  • {{MutationEvent}}.attrChange : - 0
  • -
  • {{MutationEvent}}.relatedNode : - parent node of the object whose content is being modified
  • -
  • {{MutationEvent}}.newValue : - new value of the object
  • -
  • {{MutationEvent}}.prevValue : - previous value of the object
  • -
-
- - A user agent MUST dispatch this event after - CharacterData.data or - ProcessingInstruction.data have been modified, but the - node itself has not been inserted or deleted. The event - target of this event MUST be the CharacterData node - or the ProcessingInstruction node. - -

- The EVENT{DOMCharacterDataModified} event type is defined in this - specification for reference and completeness, but this specification - deprecates the use of this event type. -

- -
DOMNodeInserted
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeInserted
Interface{{MutationEvent}}
Sync / AsyncSync
BubblesYes
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
ComposedNo
Default actionNone
Context
(trusted events)
-
    -
  • {{Event}}.{{Event/target}} : - element which is being inserted
  • -
  • {{MutationEvent}}.attrName : - the empty string
  • -
  • {{MutationEvent}}.attrChange : - 0
  • -
  • {{MutationEvent}}.relatedNode : - parent node of the node that has been inserted, or the ownerElement in the case of Attr nodes
  • -
  • {{MutationEvent}}.newValue : - the empty string
  • -
  • {{MutationEvent}}.prevValue : - the empty string
  • -
-
- - A user agent MUST dispatch this event type when a node other - than an Attr node has been added as a child of another - node. A user agent MAY dispatch this event when an - Attr node has been added to an Element - node (see note below). This - event MUST be dispatched after the insertion has taken place. The - event target of this event MUST be the node being inserted. - -

- For detecting attribute insertion, use the EVENT{DOMAttrModified} - event type instead. -

- -

- The EVENT{DOMNodeInserted} event type is defined in this - specification for reference and completeness, but this specification - deprecates the use of this event type. -

- -
DOMNodeInsertedIntoDocument
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeInsertedIntoDocument
Interface{{MutationEvent}}
Sync / AsyncSync
BubblesNo
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
ComposedNo
Default actionNone
Context
(trusted events)
-
    -
  • {{Event}}.{{Event/target}} : - element which is being inserted
  • -
  • {{MutationEvent}}.attrName : - the empty string
  • -
  • {{MutationEvent}}.attrChange : - 0
  • -
  • {{MutationEvent}}.relatedNode : - parent node of the node that has been inserted, or the ownerElement in the case of Attr nodes
  • -
  • {{MutationEvent}}.newValue : - the empty string
  • -
  • {{MutationEvent}}.prevValue : - the empty string
  • -
-
- - A user agent MUST dispatch this event when a node has been - inserted into a document, either through direct insertion of the - node or insertion of a subtree in which it is contained. A user - agent MAY treat an Attr node as part of an - Element's subtree. This event MUST be dispatched after - the insertion has taken place. The event target of this event - MUST be the node being inserted. If the node is being directly - inserted, the event type EVENT{DOMNodeInserted} MUST occur before - this event type. - -

- The EVENT{DOMNodeInsertedIntoDocument} event type is defined in this - specification for reference and completeness, but this specification - deprecates the use of this event type. -

- -
DOMNodeRemoved
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeRemoved
Interface{{MutationEvent}}
Sync / AsyncSync
BubblesYes
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
ComposedNo
Default actionNone
Context
(trusted events)
-
    -
  • {{Event}}.{{Event/target}} : - element which is being removed
  • -
  • {{MutationEvent}}.attrName : - the empty string
  • -
  • {{MutationEvent}}.attrChange : - 0
  • -
  • {{MutationEvent}}.relatedNode : - the parent node of the node being removed, or the ownerElement in the case of Attr nodes
  • -
  • {{MutationEvent}}.newValue : - the empty string
  • -
  • {{MutationEvent}}.prevValue : - the empty string
  • -
-
- - A user agent MUST dispatch this event when a node other than - an Attr node is being removed from its parent node. A - user agent MAY dispatch this event when an Attr - node is being removed from its ownerElement (see note below). This event MUST be - dispatched before the removal takes place. The event target - of this event MUST be the node being removed. - -

- For reliably detecting attribute removal, use the - EVENT{DOMAttrModified} event type instead. -

- -

- The EVENT{DOMNodeRemoved} event type is defined in this - specification for reference and completeness, but this specification - deprecates the use of this event type. -

- -
DOMNodeRemovedFromDocument
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMNodeRemovedFromDocument
Interface{{MutationEvent}}
Sync / AsyncSync
BubblesNo
Trusted TargetsElement, Attr, Text, Comment, DocumentType, - ProcessingInstruction
CancelableNo
ComposedNo
Default actionNone
Context
(trusted events)
-
    -
  • {{Event}}.{{Event/target}} : - element which is being removed
  • -
  • {{MutationEvent}}.attrName : - the empty string
  • -
  • {{MutationEvent}}.attrChange : - 0
  • -
  • {{MutationEvent}}.relatedNode : - the parent node of the node being removed, or the ownerElement in the case of Attr nodes
  • -
  • {{MutationEvent}}.newValue : - the empty string
  • -
  • {{MutationEvent}}.prevValue : - the empty string
  • -
-
- - A user agent MUST dispatch this event 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. A user - agent MAY treat an Attr node as part of an - Element's subtree. This event MUST be dispatched before - the removal takes place. The event target of this event type - MUST be the node being removed. If the node is being directly - removed, the event type EVENT{DOMNodeRemoved} MUST occur before this - event type. - -

- For reliably detecting attribute removal, use the - EVENT{DOMAttrModified} event type instead. -

- -

- The EVENT{DOMNodeRemovedFromDocument} event type is defined in this - specification for reference and completeness, but this specification - deprecates the use of this event type. -

- -
DOMSubtreeModified
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDOMSubtreeModified
Interface{{MutationEvent}}
Sync / AsyncSync
BubblesYes
Trusted TargetsWindow, Document, DocumentFragment, Element, Attr -
CancelableNo
ComposedNo
Default actionNone
Context
(trusted events)
-
    -
  • {{Event}}.{{Event/target}} : - parent node of subtree being modified
  • -
  • {{MutationEvent}}.attrName : - the empty string
  • -
  • {{MutationEvent}}.attrChange : - 0
  • -
  • {{MutationEvent}}.relatedNode : - null
  • -
  • {{MutationEvent}}.newValue : - the empty string
  • -
  • {{MutationEvent}}.prevValue : - the empty string
  • -
-
- - This is a general event for notification of all changes to the - document. It can be used instead of the more specific mutation and - mutation name events. It MAY be dispatched after a single - modification to the document or, at the implementation's discretion, - after multiple changes have occurred. The latter case SHOULD - generally be used to accommodate multiple changes which occur either - simultaneously or in rapid succession. The target of this event MUST - be the lowest common parent of the changes which have taken place. - This event MUST be dispatched after any other events caused by the - mutation(s) have occurred. - -

- The EVENT{DOMSubtreeModified} event type is defined in this - specification for reference and completeness, but this specification - deprecates the use of this event type. -

-