Skip to main content

Module dom

Module dom 

Source
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.

Types, command parameters and event payloads for the DOM domain. The method-name constants for the same domain are in crate::methods.

Structs§

AdRelatedStateUpdatedEvent
Fired when a node’s ad related state changes.
AdoptedStyleSheetsModifiedEvent
Fired when Element’s adoptedStyleSheets are modified.
AffectedByStartingStylesFlagUpdatedEvent
Fired when a node’s starting styles changes.
AttributeModifiedEvent
Fired when Element’s attribute is modified.
AttributeRemovedEvent
Fired when Element’s attribute is removed.
BackendNode
Backend node with a friendly name.
BoxModel
Box model.
CharacterDataModifiedEvent
Mirrors DOMCharacterDataModified event.
ChildNodeCountUpdatedEvent
Fired when Container’s child node count has changed.
ChildNodeInsertedEvent
Mirrors DOMNodeInserted event.
ChildNodeRemovedEvent
Mirrors DOMNodeRemoved event.
ClearTextMarkersParams
Clears the spelling and grammar error text markers overlapping the ranges set by setTextMarker in this session. These markers are also removed when the DOM domain is disabled or the session ends.
CollectClassNamesFromSubtreeParams
Collects class names for the node with given id and all of it’s child nodes.
CollectClassNamesFromSubtreeReturns
What DOM.collectClassNamesFromSubtree answers with.
CopyToParams
Creates a deep copy of the specified node and places it into the target container before the given anchor.
CopyToReturns
What DOM.copyTo answers with.
CssComputedStyleProperty
DescribeNodeParams
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
DescribeNodeReturns
What DOM.describeNode answers with.
DetachedElementInfo
A structure to hold the top-level node of a detached tree and an array of its retained descendants.
DisableParams
Disables DOM agent for the given page.
DiscardSearchResultsParams
Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
DistributedNodesUpdatedEvent
Called when distribution is changed.
DocumentUpdatedEvent
Fired when Document has been totally updated. Node ids are no longer valid.
EnableParams
Enables DOM agent for the given page.
FocusParams
Focuses the given element.
ForceShowInterestParams
When enabling, this API forces an element to gain interest in its target, keeping interest active until disabled.
ForceShowPopoverParams
When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.
ForceShowPopoverReturns
What DOM.forceShowPopover answers with.
GetAnchorElementParams
Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
GetAnchorElementReturns
What DOM.getAnchorElement answers with.
GetAttributesParams
Returns attributes for the specified node.
GetAttributesReturns
What DOM.getAttributes answers with.
GetBoxModelParams
Returns boxes for the given node.
GetBoxModelReturns
What DOM.getBoxModel answers with.
GetContainerForNodeParams
Returns the query container of the given node based on container query conditions: containerName, physical and logical axes, and whether it queries scroll-state or anchored elements. If no axes are provided and queriesScrollState is false, the style container is returned, which is the direct parent or the closest element with a matching container-name.
GetContainerForNodeReturns
What DOM.getContainerForNode answers with.
GetContentQuadsParams
Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
GetContentQuadsReturns
What DOM.getContentQuads answers with.
GetDetachedDomNodesParams
Returns list of detached nodes
GetDetachedDomNodesReturns
What DOM.getDetachedDomNodes answers with.
GetDocumentParams
Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
GetDocumentReturns
What DOM.getDocument answers with.
GetElementByRelationParams
Returns the NodeId of the matched element according to certain relations.
GetElementByRelationReturns
What DOM.getElementByRelation answers with.
GetFileInfoParams
Returns file information for the given File wrapper.
GetFileInfoReturns
What DOM.getFileInfo answers with.
GetFlattenedDocumentParams
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.
GetFlattenedDocumentReturns
What DOM.getFlattenedDocument answers with.
GetFrameOwnerParams
Returns iframe node that owns iframe with the given domain.
GetFrameOwnerReturns
What DOM.getFrameOwner answers with.
GetImplicitAnchorCandidatesParams
Returns candidate nodes that are configured as triggers for the given popover.
GetImplicitAnchorCandidatesReturns
What DOM.getImplicitAnchorCandidates answers with.
GetNodeForLocationParams
Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
GetNodeForLocationReturns
What DOM.getNodeForLocation answers with.
GetNodeStackTracesParams
Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
GetNodeStackTracesReturns
What DOM.getNodeStackTraces answers with.
GetNodesForSubtreeByStyleParams
Finds nodes with a given computed style in a subtree.
GetNodesForSubtreeByStyleReturns
What DOM.getNodesForSubtreeByStyle answers with.
GetOuterHtmlParams
Returns node’s HTML markup.
GetOuterHtmlReturns
What DOM.getOuterHTML answers with.
GetQueryingDescendantsForContainerParams
Returns the descendants of a container query container that have container queries against this container.
GetQueryingDescendantsForContainerReturns
What DOM.getQueryingDescendantsForContainer answers with.
GetRelayoutBoundaryParams
Returns the id of the nearest ancestor that is a relayout boundary.
GetRelayoutBoundaryReturns
What DOM.getRelayoutBoundary answers with.
GetSearchResultsParams
Returns search results from given fromIndex to given toIndex from the search with the given identifier.
GetSearchResultsReturns
What DOM.getSearchResults answers with.
GetTopLayerElementsParams
Returns NodeIds of current top layer elements. Top layer is rendered closest to the user within a viewport, therefore its elements always appear on top of all other content.
GetTopLayerElementsReturns
What DOM.getTopLayerElements answers with.
HideHighlightParams
Hides any highlight.
HighlightNodeParams
Highlights DOM node.
HighlightRectParams
Highlights given rectangle.
InlineStyleInvalidatedEvent
Fired when Element’s inline style is modified via a CSS property modification.
MarkUndoableStateParams
Marks last undoable state.
MoveToParams
Moves node into the new container, places it before the given anchor.
MoveToReturns
What DOM.moveTo answers with.
Node
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
PerformSearchParams
Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
PerformSearchReturns
What DOM.performSearch answers with.
PseudoElementAddedEvent
Called when a pseudo element is added to an element.
PseudoElementRemovedEvent
Called when a pseudo element is removed from an element.
PushNodeByPathToFrontendParams
Requests that the node is sent to the caller given its path. // FIXME, use XPath
PushNodeByPathToFrontendReturns
What DOM.pushNodeByPathToFrontend answers with.
PushNodesByBackendIdsToFrontendParams
Requests that a batch of nodes is sent to the caller given their backend node ids.
PushNodesByBackendIdsToFrontendReturns
What DOM.pushNodesByBackendIdsToFrontend answers with.
QuerySelectorAllParams
Executes querySelectorAll on a given node.
QuerySelectorAllReturns
What DOM.querySelectorAll answers with.
QuerySelectorParams
Executes querySelector on a given node.
QuerySelectorReturns
What DOM.querySelector answers with.
Rect
Rectangle.
RedoParams
Re-does the last undone action.
RemoveAttributeParams
Removes attribute with given name from an element with given id.
RemoveNodeParams
Removes node with given id.
RequestChildNodesParams
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.
RequestNodeParams
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.
RequestNodeReturns
What DOM.requestNode answers with.
ResolveNodeParams
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
ResolveNodeReturns
What DOM.resolveNode answers with.
Rgba
A structure holding an RGBA color.
ScrollIntoViewIfNeededParams
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.
ScrollableFlagUpdatedEvent
Fired when a node’s scrollability state changes.
SetAttributeValueParams
Sets attribute for an element with given id.
SetAttributesAsTextParams
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.
SetFileInputFilesParams
Sets files for the given file input element.
SetInspectedNodeParams
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
SetNodeNameParams
Sets node name for a node with given id.
SetNodeNameReturns
What DOM.setNodeName answers with.
SetNodeStackTracesEnabledParams
Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
SetNodeValueParams
Sets node value for a node with given id.
SetOuterHtmlParams
Sets node HTML markup, returns new node id.
SetTextMarkerParams
Sets a spelling or grammar error marker on the given range of text. See https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
ShadowRootPoppedEvent
Called when shadow root is popped from the element.
ShadowRootPushedEvent
Called when shadow root is pushed into the element.
ShapeOutsideInfo
CSS Shape Outside details.
TopLayerElementsUpdatedEvent
Called when top layer elements are changed.
UndoParams
Undoes the last performed action.

Enums§

CompatibilityMode
Document compatibility mode.
EnableIncludeWhitespace
The values includeWhitespace accepts on enable.
GetElementByRelationRelation
The values relation accepts on getElementByRelation.
LogicalAxes
ContainerSelector logical axes
PhysicalAxes
ContainerSelector physical axes
PseudoType
Pseudo element type.
ScrollOrientation
Physical scroll orientation
SetTextMarkerType
The values type accepts on setTextMarker.
ShadowRootType
Shadow root type.

Type Aliases§

BackendNodeId
Unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
NodeId
Unique DOM node identifier.
Quad
An array of quad vertices, x immediately followed by y for each point, points clock-wise.
StyleSheetId
Unique identifier for a CSS stylesheet.