Class MutationObserver

Class MutationObserver

Namespace: Aspose.Html.Dom.Mutations
Assembly: Aspose.HTML.dll (25.2.0)

A Aspose.Html.Dom.Mutations.MutationObserver object can be used to observe mutations to the tree of Aspose.Html.Dom.Node.

[ComVisible(true)]
[DOMObject]
[DOMName("MutationObserver")]
public class MutationObserver : DOMObject, INotifyPropertyChanged

Inheritance

objectDOMObjectMutationObserver

Implements

INotifyPropertyChanged

Inherited Members

DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

MutationObserver(MutationCallback)

Constructs a MutationObserver object and sets its Aspose.Html.Dom.Mutations.MutationCallback to callback. The callback is invoked with a list of MutationRecord objects as first argument and the constructed MutationObserver object as second argument. It is invoked after nodes registered with the Aspose.Html.Dom.Mutations.MutationObserver.Observe(Aspose.Html.Dom.Node,Aspose.Html.Dom.Mutations.MutationObserverInit) method, are mutated.

[DOMConstructor]
public MutationObserver(MutationCallback callback)

Parameters

callback MutationCallback

The callback.

Methods

Disconnect()

Stops observer from observing any mutations. Until the observe() method is used again, observer’s callback will not be invoked.

[DOMName("disconnect")]
public void Disconnect()

Observe(Node)

Instructs the user agent to observe a given target (a node) and report any mutations based on the criteria given by options (an object). The options argument allows for setting mutation observation options via object members.

[DOMName("observe")]
public void Observe(Node target)

Parameters

target Node

The target for observe.

Observe(Node, MutationObserverInit)

Instructs the user agent to observe a given target (a node) and report any mutations based on the criteria given by options (an object). The options argument allows for setting mutation observation options via object members.

[DOMName("observe")]
public void Observe(Node target, MutationObserverInit options)

Parameters

target Node

The target for observe.

options MutationObserverInit

The observer options.

TakeRecords()

The method returns a copy of the record queue and then empty the record queue.

[DOMName("takeRecords")]
public IList<mutationrecord> TakeRecords()

Returns

IList<MutationRecord&gt;

The copy of the record queue.