Package org.pepstock.charba.client.dom
Class MutationObserver
- java.lang.Object
-
- org.pepstock.charba.client.dom.MutationObserver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MutationObserver.MutationObserverCallback
A function which will be called on each DOM change that qualifies given the targeted node or subtree and options.
-
Constructor Summary
Constructors Constructor Description MutationObserver(MutationObserver.MutationObserverCallback callback)
Creates and returns a new mutation observer which will invoke a specified callback function when DOM changes occur.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disconnect()
Stops the mutation observer instance from receiving further notifications until and unlessobserve(BaseNode)
is called again.void
observe(BaseNode target)
Configures the mutation observer to begin receiving notifications through its callback function when DOM changes matching the given options occur.void
observe(BaseNode target, MutationObserverInit options)
Configures the mutation observer to begin receiving notifications through its callback function when DOM changes matching the given options occur.MutationRecord[]
takeRecords()
Removes all pending notifications from the mutation observer's notification queue and returns them in a new array of mutation record objects.
-
-
-
Constructor Detail
-
MutationObserver
public MutationObserver(MutationObserver.MutationObserverCallback callback)
Creates and returns a new mutation observer which will invoke a specified callback function when DOM changes occur.- Parameters:
callback
- a function which will be called on each DOM change that qualifies given the targeted node or subtree and options
-
-
Method Detail
-
disconnect
public void disconnect()
Stops the mutation observer instance from receiving further notifications until and unlessobserve(BaseNode)
is called again.
-
observe
public void observe(BaseNode target, MutationObserverInit options)
Configures the mutation observer to begin receiving notifications through its callback function when DOM changes matching the given options occur.- Parameters:
target
- a DOM node within the DOM tree to watch for changes, or to be the root of a subtree of nodes to be watchedoptions
- initialization object providing options that describe what DOM mutations should be reported to the observer's callback
-
observe
public void observe(BaseNode target)
Configures the mutation observer to begin receiving notifications through its callback function when DOM changes matching the given options occur.- Parameters:
target
- a DOM node within the DOM tree to watch for changes, or to be the root of a subtree of nodes to be watched
-
takeRecords
public MutationRecord[] takeRecords()
Removes all pending notifications from the mutation observer's notification queue and returns them in a new array of mutation record objects.- Returns:
- all pending notifications from the mutation observer's notification queue
-
-