Package org.pepstock.charba.client.dom
Class MutationRecord
- java.lang.Object
-
- org.pepstock.charba.client.dom.MutationRecord
-
@JsType(isNative=true, namespace="<global>") public final class MutationRecord extends Object
Represents an individual DOM mutation. It is the object that is passed toMutationObserver.MutationObserverCallback
's callback.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<BaseHtmlElement>
getAddedElements()
Returns the elements added.
Will be an empty element list if no elements were added.BaseNode
getNextSibling()
Returns the next sibling of the added or removed nodes, or null.BaseNode
getPreviousSibling()
Returns the previous sibling of the added or removed nodes, or null.List<BaseHtmlElement>
getRemovedElements()
Returns the elements removed.
Will be an empty element list if no elements were removed.BaseNode
getTarget()
Returns the node the mutation affected, depending on theMutationType
.MutationType
getType()
ReturnsMutationType.ATTRIBUTES
if the mutation was an attribute mutation,MutationType.CHARACTER_DATA
if it was a mutation to a CharacterData node, andMutationType.CHILD_LIST
if it was a mutation to the tree of nodes.
-
-
-
Method Detail
-
getAddedElements
@JsOverlay public List<BaseHtmlElement> getAddedElements()
Returns the elements added.
Will be an empty element list if no elements were added.- Returns:
- the elements added
-
getNextSibling
@JsProperty public BaseNode getNextSibling()
Returns the next sibling of the added or removed nodes, or null.- Returns:
- the next sibling of the added or removed nodes, or null
-
getPreviousSibling
@JsProperty public BaseNode getPreviousSibling()
Returns the previous sibling of the added or removed nodes, or null.- Returns:
- the previous sibling of the added or removed nodes, or null
-
getRemovedElements
@JsOverlay public List<BaseHtmlElement> getRemovedElements()
Returns the elements removed.
Will be an empty element list if no elements were removed.- Returns:
- the elements removed
-
getTarget
@JsProperty public BaseNode getTarget()
Returns the node the mutation affected, depending on theMutationType
. ForMutationType.ATTRIBUTES
, it is the element whose attribute changed. ForMutationType.CHARACTER_DATA
, it is the character data node. ForMutationType.CHILD_LIST
, it is the node whose children changed.- Returns:
- the node the mutation affected
-
getType
@JsOverlay public MutationType getType()
ReturnsMutationType.ATTRIBUTES
if the mutation was an attribute mutation,MutationType.CHARACTER_DATA
if it was a mutation to a CharacterData node, andMutationType.CHILD_LIST
if it was a mutation to the tree of nodes.- Returns:
- the type of mutation record
-
-