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:
Serializable
,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 for
MutationObserver
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private org.htmlunit.corejs.javascript.NativeArray
private boolean
private boolean
private boolean
private org.htmlunit.corejs.javascript.Function
private Node
private boolean
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Notification that a new attribute was added to the HtmlElement.void
Notification that an existing attribute has been removed from the HtmlElement.void
Notification that an attribute on the HtmlElement has been replaced.void
Notification that a Character Data was added.void
Stops the MutationObserver instance from receiving notifications of DOM mutations.void
jsConstructor
(org.htmlunit.corejs.javascript.Function function) Creates an instance.void
Registers theMutationObserver
instance to receive notifications of DOM mutations on the specified node.org.htmlunit.corejs.javascript.Scriptable
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 Details
-
function_
private org.htmlunit.corejs.javascript.Function function_ -
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_
-
-
Constructor Details
-
MutationObserver
public MutationObserver()Creates an instance.
-
-
Method Details
-
jsConstructor
public void jsConstructor(org.htmlunit.corejs.javascript.Function function) Creates an instance.- Parameters:
function
- the function to observe
-
observe
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
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
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
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
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
-