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

    Fields
    Modifier and Type
    Field
    Description
    private 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
    Constructor
    Description
    Creates an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    observe(Node node, org.htmlunit.corejs.javascript.NativeObject options)
    Registers the MutationObserver 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.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

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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_
  • 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

      public void observe(Node node, org.htmlunit.corejs.javascript.NativeObject options)
      Registers the MutationObserver instance to receive notifications of DOM mutations on the specified node.
      Parameters:
      node - the node
      options - 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 of MutationRecords
    • characterDataChanged

      public void characterDataChanged(CharacterDataChangeEvent event)
      Notification that a Character Data was added. Called after it is changed.
      Specified by:
      characterDataChanged in interface CharacterDataChangeListener
      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 interface HtmlAttributeChangeListener
      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 interface HtmlAttributeChangeListener
      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 interface HtmlAttributeChangeListener
      Parameters:
      event - the attribute change event