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 org.w3c.dom.events.Event
AT_TARGET, BUBBLING_PHASE, 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 org.w3c.dom.events.Event
getBubbles, getCancelable, getCurrentTarget, getEventPhase, getTarget, getTimeStamp, getType, initEvent, preventDefault, stopPropagation
-
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
-