Package org.htmlunit.javascript.host.dom
Class MutationObserver
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.javascript.HtmlUnitScriptable
-
- org.htmlunit.javascript.host.dom.MutationObserver
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
,CharacterDataChangeListener
,HtmlAttributeChangeListener
public class MutationObserver extends HtmlUnitScriptable implements HtmlAttributeChangeListener, CharacterDataChangeListener
A JavaScript object forMutationObserver
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
attaributes_
private org.htmlunit.corejs.javascript.NativeArray
attributeFilter_
private boolean
attributeOldValue_
private boolean
characterData_
private boolean
characterDataOldValue_
private org.htmlunit.corejs.javascript.Function
function_
private Node
node_
private boolean
subtree_
-
Constructor Summary
Constructors Constructor Description MutationObserver()
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attributeAdded(HtmlAttributeChangeEvent event)
Notification that a new attribute was added to the HtmlElement.void
attributeRemoved(HtmlAttributeChangeEvent event)
Notification that an existing attribute has been removed from the HtmlElement.void
attributeReplaced(HtmlAttributeChangeEvent event)
Notification that an attribute on the HtmlElement has been replaced.void
characterDataChanged(CharacterDataChangeEvent event)
Notification that a Character Data was added.void
disconnect()
Stops the MutationObserver instance from receiving notifications of DOM mutations.void
jsConstructor(org.htmlunit.corejs.javascript.Function function)
Creates an instance.void
observe(Node node, org.htmlunit.corejs.javascript.NativeObject options)
Registers theMutationObserver
instance to receive notifications of DOM mutations on the specified node.org.htmlunit.corejs.javascript.Scriptable
takeRecords()
Empties the MutationObserver instance's record queue and returns what was in there.-
Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
-
-
-
Field Detail
-
function_
private org.htmlunit.corejs.javascript.Function function_
-
node_
private Node node_
-
attaributes_
private boolean attaributes_
-
attributeOldValue_
private boolean attributeOldValue_
-
attributeFilter_
private org.htmlunit.corejs.javascript.NativeArray attributeFilter_
-
characterData_
private boolean characterData_
-
characterDataOldValue_
private boolean characterDataOldValue_
-
subtree_
private boolean subtree_
-
-
Method Detail
-
jsConstructor
public void jsConstructor(org.htmlunit.corejs.javascript.Function function)
Creates an instance.- Parameters:
function
- the function to observe
-
observe
public void observe(Node node, org.htmlunit.corejs.javascript.NativeObject options)
Registers theMutationObserver
instance to receive notifications of DOM mutations on the specified node.- Parameters:
node
- the nodeoptions
- the options
-
disconnect
public void disconnect()
Stops the MutationObserver instance from receiving notifications of DOM mutations.
-
takeRecords
public org.htmlunit.corejs.javascript.Scriptable takeRecords()
Empties the MutationObserver instance's record queue and returns what was in there.- Returns:
- an
NativeArray
ofMutationRecord
s
-
characterDataChanged
public void characterDataChanged(CharacterDataChangeEvent event)
Notification that a Character Data was added. Called after it is changed.- Specified by:
characterDataChanged
in interfaceCharacterDataChangeListener
- Parameters:
event
- the character data change event
-
attributeAdded
public void attributeAdded(HtmlAttributeChangeEvent event)
Notification that a new attribute was added to the HtmlElement. Called after the attribute is added.- Specified by:
attributeAdded
in interfaceHtmlAttributeChangeListener
- Parameters:
event
- the attribute change event
-
attributeRemoved
public void attributeRemoved(HtmlAttributeChangeEvent event)
Notification that an existing attribute has been removed from the HtmlElement. Called after the attribute is removed.- Specified by:
attributeRemoved
in interfaceHtmlAttributeChangeListener
- Parameters:
event
- the attribute change event
-
attributeReplaced
public void attributeReplaced(HtmlAttributeChangeEvent event)
Notification that an attribute on the HtmlElement has been replaced. Called after the attribute is replaced.- Specified by:
attributeReplaced
in interfaceHtmlAttributeChangeListener
- Parameters:
event
- the attribute change event
-
-