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§
- AdRelated
State Updated Event - Fired when a node’s ad related state changes.
- Adopted
Style Sheets Modified Event - Fired when
Element’s adoptedStyleSheets are modified. - Affected
ByStarting Styles Flag Updated Event - Fired when a node’s starting styles changes.
- Attribute
Modified Event - Fired when
Element’s attribute is modified. - Attribute
Removed Event - Fired when
Element’s attribute is removed. - Backend
Node - Backend node with a friendly name.
- BoxModel
- Box model.
- Character
Data Modified Event - Mirrors
DOMCharacterDataModifiedevent. - Child
Node Count Updated Event - Fired when
Container’s child node count has changed. - Child
Node Inserted Event - Mirrors
DOMNodeInsertedevent. - Child
Node Removed Event - Mirrors
DOMNodeRemovedevent. - Clear
Text Markers Params - 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.
- Collect
Class Names From Subtree Params - Collects class names for the node with given id and all of it’s child nodes.
- Collect
Class Names From Subtree Returns - What
DOM.collectClassNamesFromSubtreeanswers with. - Copy
ToParams - Creates a deep copy of the specified node and places it into the target container before the given anchor.
- Copy
ToReturns - What
DOM.copyToanswers with. - CssComputed
Style Property - Describe
Node Params - Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
- Describe
Node Returns - What
DOM.describeNodeanswers with. - Detached
Element Info - A structure to hold the top-level node of a detached tree and an array of its retained descendants.
- Disable
Params - Disables DOM agent for the given page.
- Discard
Search Results Params - Discards search results from the session with the given id.
getSearchResultsshould no longer be called for that search. - Distributed
Nodes Updated Event - Called when distribution is changed.
- Document
Updated Event - Fired when
Documenthas been totally updated. Node ids are no longer valid. - Enable
Params - Enables DOM agent for the given page.
- Focus
Params - Focuses the given element.
- Force
Show Interest Params - When enabling, this API forces an element to gain interest in its target, keeping interest active until disabled.
- Force
Show Popover Params - When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.
- Force
Show Popover Returns - What
DOM.forceShowPopoveranswers with. - GetAnchor
Element Params - Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
- GetAnchor
Element Returns - What
DOM.getAnchorElementanswers with. - GetAttributes
Params - Returns attributes for the specified node.
- GetAttributes
Returns - What
DOM.getAttributesanswers with. - GetBox
Model Params - Returns boxes for the given node.
- GetBox
Model Returns - What
DOM.getBoxModelanswers with. - GetContainer
ForNode Params - 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.
- GetContainer
ForNode Returns - What
DOM.getContainerForNodeanswers with. - GetContent
Quads Params - Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
- GetContent
Quads Returns - What
DOM.getContentQuadsanswers with. - GetDetached
DomNodes Params - Returns list of detached nodes
- GetDetached
DomNodes Returns - What
DOM.getDetachedDomNodesanswers with. - GetDocument
Params - Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
- GetDocument
Returns - What
DOM.getDocumentanswers with. - GetElement
ByRelation Params - Returns the NodeId of the matched element according to certain relations.
- GetElement
ByRelation Returns - What
DOM.getElementByRelationanswers with. - GetFile
Info Params - Returns file information for the given File wrapper.
- GetFile
Info Returns - What
DOM.getFileInfoanswers with. - GetFlattened
Document Params - 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.
- GetFlattened
Document Returns - What
DOM.getFlattenedDocumentanswers with. - GetFrame
Owner Params - Returns iframe node that owns iframe with the given domain.
- GetFrame
Owner Returns - What
DOM.getFrameOwneranswers with. - GetImplicit
Anchor Candidates Params - Returns candidate nodes that are configured as triggers for the given popover.
- GetImplicit
Anchor Candidates Returns - What
DOM.getImplicitAnchorCandidatesanswers with. - GetNode
ForLocation Params - Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
- GetNode
ForLocation Returns - What
DOM.getNodeForLocationanswers with. - GetNode
Stack Traces Params - Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
- GetNode
Stack Traces Returns - What
DOM.getNodeStackTracesanswers with. - GetNodes
ForSubtree ByStyle Params - Finds nodes with a given computed style in a subtree.
- GetNodes
ForSubtree ByStyle Returns - What
DOM.getNodesForSubtreeByStyleanswers with. - GetOuter
Html Params - Returns node’s HTML markup.
- GetOuter
Html Returns - What
DOM.getOuterHTMLanswers with. - GetQuerying
Descendants ForContainer Params - Returns the descendants of a container query container that have container queries against this container.
- GetQuerying
Descendants ForContainer Returns - What
DOM.getQueryingDescendantsForContaineranswers with. - GetRelayout
Boundary Params - Returns the id of the nearest ancestor that is a relayout boundary.
- GetRelayout
Boundary Returns - What
DOM.getRelayoutBoundaryanswers with. - GetSearch
Results Params - Returns search results from given
fromIndexto giventoIndexfrom the search with the given identifier. - GetSearch
Results Returns - What
DOM.getSearchResultsanswers with. - GetTop
Layer Elements Params - 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.
- GetTop
Layer Elements Returns - What
DOM.getTopLayerElementsanswers with. - Hide
Highlight Params - Hides any highlight.
- Highlight
Node Params - Highlights DOM node.
- Highlight
Rect Params - Highlights given rectangle.
- Inline
Style Invalidated Event - Fired when
Element’s inline style is modified via a CSS property modification. - Mark
Undoable State Params - Marks last undoable state.
- Move
ToParams - Moves node into the new container, places it before the given anchor.
- Move
ToReturns - What
DOM.moveToanswers with. - Node
- DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
- Perform
Search Params - Searches for a given string in the DOM tree. Use
getSearchResultsto access search results orcancelSearchto end this search session. - Perform
Search Returns - What
DOM.performSearchanswers with. - Pseudo
Element Added Event - Called when a pseudo element is added to an element.
- Pseudo
Element Removed Event - Called when a pseudo element is removed from an element.
- Push
Node ByPath ToFrontend Params - Requests that the node is sent to the caller given its path. // FIXME, use XPath
- Push
Node ByPath ToFrontend Returns - What
DOM.pushNodeByPathToFrontendanswers with. - Push
Nodes ByBackend IdsTo Frontend Params - Requests that a batch of nodes is sent to the caller given their backend node ids.
- Push
Nodes ByBackend IdsTo Frontend Returns - What
DOM.pushNodesByBackendIdsToFrontendanswers with. - Query
Selector AllParams - Executes
querySelectorAllon a given node. - Query
Selector AllReturns - What
DOM.querySelectorAllanswers with. - Query
Selector Params - Executes
querySelectoron a given node. - Query
Selector Returns - What
DOM.querySelectoranswers with. - Rect
- Rectangle.
- Redo
Params - Re-does the last undone action.
- Remove
Attribute Params - Removes attribute with given name from an element with given id.
- Remove
Node Params - Removes node with given id.
- Request
Child Nodes Params - Requests that children of the node with given id are returned to the
caller in form of
setChildNodesevents where not only immediate children are retrieved, but all children down to the specified depth. - Request
Node Params - 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
setChildNodesnotifications. - Request
Node Returns - What
DOM.requestNodeanswers with. - Resolve
Node Params - Resolves the JavaScript node object for a given NodeId or BackendNodeId.
- Resolve
Node Returns - What
DOM.resolveNodeanswers with. - Rgba
- A structure holding an RGBA color.
- Scroll
Into View IfNeeded Params - 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.
- Scrollable
Flag Updated Event - Fired when a node’s scrollability state changes.
- SetAttribute
Value Params - Sets attribute for an element with given id.
- SetAttributes
AsText Params - 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.
- SetChild
Nodes Event - Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
- SetFile
Input Files Params - Sets files for the given file input element.
- SetInspected
Node Params - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
- SetNode
Name Params - Sets node name for a node with given id.
- SetNode
Name Returns - What
DOM.setNodeNameanswers with. - SetNode
Stack Traces Enabled Params - Sets if stack traces should be captured for Nodes. See
Node.getNodeStackTraces. Default is disabled. - SetNode
Value Params - Sets node value for a node with given id.
- SetOuter
Html Params - Sets node HTML markup, returns new node id.
- SetText
Marker Params - 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.
- Shadow
Root Popped Event - Called when shadow root is popped from the element.
- Shadow
Root Pushed Event - Called when shadow root is pushed into the element.
- Shape
Outside Info - CSS Shape Outside details.
- TopLayer
Elements Updated Event - Called when top layer elements are changed.
- Undo
Params - Undoes the last performed action.
Enums§
- Compatibility
Mode - Document compatibility mode.
- Enable
Include Whitespace - The values
includeWhitespaceaccepts onenable. - GetElement
ByRelation Relation - The values
relationaccepts ongetElementByRelation. - Logical
Axes - ContainerSelector logical axes
- Physical
Axes - ContainerSelector physical axes
- Pseudo
Type - Pseudo element type.
- Scroll
Orientation - Physical scroll orientation
- SetText
Marker Type - The values
typeaccepts onsetTextMarker. - Shadow
Root Type - Shadow root type.
Type Aliases§
- Backend
Node Id - 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.
- Style
Sheet Id - Unique identifier for a CSS stylesheet.