Interface MutationEvent
- All Superinterfaces:
Event
The
MutationEvent interface provides specific contextual
information associated with Mutation events.
See also the Document Object Model (DOM) Level 2 Events Specification.
- Since:
- 1.5, DOM Level 2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortTheAttrwas just added.static final shortTheAttrwas modified in place.static final shortTheAttrwas just removed.Fields declared in interface Event
AT_TARGET, BUBBLING_PHASE, CAPTURING_PHASEModifier and TypeFieldDescriptionstatic final shortThe event is currently being evaluated at the targetEventTarget.static final shortThe current event phase is the bubbling phase.static final shortThe current event phase is the capturing phase. -
Method Summary
Modifier and TypeMethodDescriptionshortattrChangeindicates the type of change which triggered the DOMAttrModified event.attrNameindicates the name of the changedAttrnode in a DOMAttrModified event.newValueindicates the new value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.prevValueindicates the previous value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.relatedNodeis used to identify a secondary node related to a mutation event.voidinitMutationEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevValueArg, String newValueArg, String attrNameArg, short attrChangeArg) TheinitMutationEventmethod is used to initialize the value of aMutationEventcreated through theDocumentEventinterface.Methods declared in interface Event
getBubbles, getCancelable, getCurrentTarget, getEventPhase, getTarget, getTimeStamp, getType, initEvent, preventDefault, stopPropagationModifier and TypeMethodDescriptionbooleanUsed to indicate whether or not an event is a bubbling event.booleanUsed to indicate whether or not an event can have its default action prevented.Used to indicate theEventTargetwhoseEventListenersare currently being processed.shortUsed to indicate which phase of event flow is currently being evaluated.Used to indicate theEventTargetto which the event was originally dispatched.longUsed to specify the time (in milliseconds relative to the epoch) at which the event was created.getType()The name of the event (case-insensitive).voidTheinitEventmethod is used to initialize the value of anEventcreated through theDocumentEventinterface.voidIf an event is cancelable, thepreventDefaultmethod 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.voidThestopPropagationmethod is used prevent further propagation of an event during event flow.
-
Field Details
-
MODIFICATION
static final short MODIFICATIONTheAttrwas modified in place.- See Also:
-
ADDITION
static final short ADDITIONTheAttrwas just added.- See Also:
-
REMOVAL
static final short REMOVALTheAttrwas just removed.- See Also:
-
-
Method Details
-
getRelatedNode
Node getRelatedNode()relatedNodeis 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, therelatedNodeis the changed parent. If an event is instead dispatched to a subtree indicating a node was changed within it, therelatedNodeis the changed node. In the case of the DOMAttrModified event it indicates theAttrnode which was modified, added, or removed. -
getPrevValue
String getPrevValue()prevValueindicates the previous value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events. -
getNewValue
String getNewValue()newValueindicates the new value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events. -
getAttrName
String getAttrName()attrNameindicates the name of the changedAttrnode in a DOMAttrModified event. -
getAttrChange
short getAttrChange()attrChangeindicates the type of change which triggered the DOMAttrModified event. The values can beMODIFICATION,ADDITION, orREMOVAL. -
initMutationEvent
void initMutationEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevValueArg, String newValueArg, String attrNameArg, short attrChangeArg) TheinitMutationEventmethod is used to initialize the value of aMutationEventcreated through theDocumentEventinterface. This method may only be called before theMutationEventhas been dispatched via thedispatchEventmethod, though it may be called multiple times during that phase if necessary. If called multiple times, the final invocation takes precedence.- Parameters:
typeArg- Specifies the event type.canBubbleArg- Specifies whether or not the event can bubble.cancelableArg- Specifies whether or not the event's default action can be prevented.relatedNodeArg- Specifies theEvent's related Node.prevValueArg- Specifies theEvent'sprevValueattribute. This value may be null.newValueArg- Specifies theEvent'snewValueattribute. This value may be null.attrNameArg- Specifies theEvent'sattrNameattribute. This value may be null.attrChangeArg- Specifies theEvent'sattrChangeattribute
-