Module dom

Module dom 

Source
Available on crate features DOM and Runtime only.
Expand description

This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id. This id can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client’s responsibility to collect information about the nodes that were sent to the client.

Note that iframe owner elements will return corresponding document elements as their child nodes.

Structs§

AttributeModifiedEvent
Fired when Element’s attribute is modified.
AttributeRemovedEvent
Fired when Element’s attribute is removed.
BackendNode
Backend node with a friendly name.
BackendNodeId
Unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
BoxModel
Box model.
BoxModelBuilder
CharacterDataModifiedEvent
Mirrors DOMCharacterDataModified event.
ChildNodeCountUpdatedEvent
Fired when Container’s child node count has changed.
ChildNodeInsertedEvent
Mirrors DOMNodeInserted event.
ChildNodeRemovedEvent
Mirrors DOMNodeRemoved event.
CollectClassNamesFromSubtreeCommandexperimental
Collects class names for the node with given id and all of it’s child nodes.
CollectClassNamesFromSubtreeReturnexperimental
Collects class names for the node with given id and all of it’s child nodes.
CopyToCommandexperimental
Creates a deep copy of the specified node and places it into the target container before the given anchor.
CopyToReturnexperimental
Creates a deep copy of the specified node and places it into the target container before the given anchor.
CssComputedStyleProperty
DescribeNodeCommand
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
DescribeNodeCommandBuilder
DescribeNodeReturn
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
DisableCommand
Disables DOM agent for the given page.
DisableReturn
Disables DOM agent for the given page.
DiscardSearchResultsCommandexperimental
Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
DiscardSearchResultsReturnexperimental
Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
DistributedNodesUpdatedEventexperimental
Called when distrubution is changed.
DocumentUpdatedEvent
Fired when Document has been totally updated. Node ids are no longer valid.
EnableCommand
Enables DOM agent for the given page.
EnableReturn
Enables DOM agent for the given page.
FocusCommand
Focuses the given element.
FocusReturn
Focuses the given element.
GetAttributesCommand
Returns attributes for the specified node.
GetAttributesReturn
Returns attributes for the specified node.
GetBoxModelCommand
Returns boxes for the given node.
GetBoxModelReturn
Returns boxes for the given node.
GetContentQuadsCommandexperimental
Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
GetContentQuadsReturnexperimental
Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
GetDocumentCommand
Returns the root DOM node (and optionally the subtree) to the caller.
GetDocumentReturn
Returns the root DOM node (and optionally the subtree) to the caller.
GetFileInfoCommandexperimental
Returns file information for the given File wrapper.
GetFileInfoReturnexperimental
Returns file information for the given File wrapper.
GetFlattenedDocumentCommandDeprecated
Returns the root DOM node (and optionally the subtree) to the caller. Deprecated, as it is not designed to work well with the rest of the DOM agent. Use DOMSnapshot.captureSnapshot instead.
GetFlattenedDocumentReturnDeprecated
Returns the root DOM node (and optionally the subtree) to the caller. Deprecated, as it is not designed to work well with the rest of the DOM agent. Use DOMSnapshot.captureSnapshot instead.
GetFrameOwnerCommandexperimental
Returns iframe node that owns iframe with the given domain.
GetFrameOwnerReturnexperimental
Returns iframe node that owns iframe with the given domain.
GetNodeForLocationCommand
Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
GetNodeForLocationCommandBuilder
GetNodeForLocationReturn
Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
GetNodeStackTracesCommandexperimental
Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
GetNodeStackTracesReturnexperimental
Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
GetNodesForSubtreeByStyleCommandexperimental
Finds nodes with a given computed style in a subtree.
GetNodesForSubtreeByStyleReturnexperimental
Finds nodes with a given computed style in a subtree.
GetOuterHtmlCommand
Returns node’s HTML markup.
GetOuterHtmlReturn
Returns node’s HTML markup.
GetRelayoutBoundaryCommandexperimental
Returns the id of the nearest ancestor that is a relayout boundary.
GetRelayoutBoundaryReturnexperimental
Returns the id of the nearest ancestor that is a relayout boundary.
GetSearchResultsCommandexperimental
Returns search results from given fromIndex to given toIndex from the search with the given identifier.
GetSearchResultsReturnexperimental
Returns search results from given fromIndex to given toIndex from the search with the given identifier.
HideHighlightCommand
Hides any highlight.
HideHighlightReturn
Hides any highlight.
HighlightNodeCommand
Highlights DOM node.
HighlightNodeReturn
Highlights DOM node.
HighlightRectCommand
Highlights given rectangle.
HighlightRectReturn
Highlights given rectangle.
InlineStyleInvalidatedEventexperimental
Fired when Element’s inline style is modified via a CSS property modification.
MarkUndoableStateCommandexperimental
Marks last undoable state.
MarkUndoableStateReturnexperimental
Marks last undoable state.
MoveToCommand
Moves node into the new container, places it before the given anchor.
MoveToReturn
Moves node into the new container, places it before the given anchor.
Node
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
NodeBuilder
NodeId
Unique DOM node identifier.
PerformSearchCommandexperimental
Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
PerformSearchReturnexperimental
Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
PseudoElementAddedEventexperimental
Called when a pseudo element is added to an element.
PseudoElementRemovedEventexperimental
Called when a pseudo element is removed from an element.
PushNodeByPathToFrontendCommandexperimental
Requests that the node is sent to the caller given its path. // FIXME, use XPath
PushNodeByPathToFrontendReturnexperimental
Requests that the node is sent to the caller given its path. // FIXME, use XPath
PushNodesByBackendIdsToFrontendCommandexperimental
Requests that a batch of nodes is sent to the caller given their backend node ids.
PushNodesByBackendIdsToFrontendReturnexperimental
Requests that a batch of nodes is sent to the caller given their backend node ids.
Quad
An array of quad vertices, x immediately followed by y for each point, points clock-wise.
QuerySelectorAllCommand
Executes querySelectorAll on a given node.
QuerySelectorAllReturn
Executes querySelectorAll on a given node.
QuerySelectorCommand
Executes querySelector on a given node.
QuerySelectorReturn
Executes querySelector on a given node.
Rect
Rectangle.
RectBuilder
RedoCommandexperimental
Re-does the last undone action.
RedoReturnexperimental
Re-does the last undone action.
RemoveAttributeCommand
Removes attribute with given name from an element with given id.
RemoveAttributeReturn
Removes attribute with given name from an element with given id.
RemoveNodeCommand
Removes node with given id.
RemoveNodeReturn
Removes node with given id.
RequestChildNodesCommand
Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.
RequestChildNodesReturn
Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.
RequestNodeCommand
Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications.
RequestNodeReturn
Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications.
ResolveNodeCommand
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
ResolveNodeCommandBuilder
ResolveNodeReturn
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
Rgba
A structure holding an RGBA color.
RgbaBuilder
ScrollIntoViewIfNeededCommandexperimental
Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
ScrollIntoViewIfNeededCommandBuilderexperimental
ScrollIntoViewIfNeededReturnexperimental
Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
SetAttributeValueCommand
Sets attribute for an element with given id.
SetAttributeValueReturn
Sets attribute for an element with given id.
SetAttributesAsTextCommand
Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
SetAttributesAsTextReturn
Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
SetChildNodesEvent
Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
SetFileInputFilesCommand
Sets files for the given file input element.
SetFileInputFilesCommandBuilder
SetFileInputFilesReturn
Sets files for the given file input element.
SetInspectedNodeCommandexperimental
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
SetInspectedNodeReturnexperimental
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
SetNodeNameCommand
Sets node name for a node with given id.
SetNodeNameReturn
Sets node name for a node with given id.
SetNodeStackTracesEnabledCommandexperimental
Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
SetNodeStackTracesEnabledReturnexperimental
Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
SetNodeValueCommand
Sets node value for a node with given id.
SetNodeValueReturn
Sets node value for a node with given id.
SetOuterHtmlCommand
Sets node HTML markup, returns new node id.
SetOuterHtmlReturn
Sets node HTML markup, returns new node id.
ShadowRootPoppedEventexperimental
Called when shadow root is popped from the element.
ShadowRootPushedEventexperimental
Called when shadow root is pushed into the element.
ShapeOutsideInfo
CSS Shape Outside details.
UndoCommandexperimental
Undoes the last performed action.
UndoReturnexperimental
Undoes the last performed action.

Enums§

PseudoType
ShadowRootType