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 booleanprivate org.htmlunit.corejs.javascript.NativeArrayprivate booleanprivate booleanprivate booleanprivate org.htmlunit.corejs.javascript.Functionprivate Nodeprivate booleanFields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNotification that a new attribute was added to the HtmlElement.voidNotification that an existing attribute has been removed from the HtmlElement.voidNotification that an attribute on the HtmlElement has been replaced.voidNotification that a Character Data was added.voidStops the MutationObserver instance from receiving notifications of DOM mutations.voidjsConstructor(org.htmlunit.corejs.javascript.Function function) Creates an instance.voidRegisters theMutationObserverinstance to receive notifications of DOM mutations on the specified node.org.htmlunit.corejs.javascript.ScriptableEmpties the MutationObserver instance's record queue and returns what was in there.Methods inherited from class 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, setupRejectedPromiseMethods 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 theMutationObserverinstance 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
NativeArrayofMutationRecords
-
characterDataChanged
Notification that a Character Data was added. Called after it is changed.- Specified by:
characterDataChangedin 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:
attributeAddedin 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:
attributeRemovedin 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:
attributeReplacedin interfaceHtmlAttributeChangeListener- Parameters:
event- the attribute change event
-