pub struct DOMNode<'a> { /* private fields */ }Expand description
A Node in the DOM tree.
Implementations§
Source§impl<'a> DOMNode<'a>
impl<'a> DOMNode<'a>
Sourcepub fn builder(
node_type: i64,
node_name: impl Into<Cow<'a, str>>,
node_value: impl Into<Cow<'a, str>>,
backend_node_id: BackendNodeId,
) -> DOMNodeBuilder<'a>
pub fn builder( node_type: i64, node_name: impl Into<Cow<'a, str>>, node_value: impl Into<Cow<'a, str>>, backend_node_id: BackendNodeId, ) -> DOMNodeBuilder<'a>
Creates a builder for this type with the required parameters:
node_type:Node’s nodeType.node_name:Node’s nodeName.node_value:Node’s nodeValue.backend_node_id:Node’s id, corresponds to DOM.Node.backendNodeId.
Sourcepub fn node_value(&self) -> &str
pub fn node_value(&self) -> &str
‘Node’’s nodeValue.
Sourcepub fn text_value(&self) -> Option<&str>
pub fn text_value(&self) -> Option<&str>
Only set for textarea elements, contains the text value.
Sourcepub fn input_value(&self) -> Option<&str>
pub fn input_value(&self) -> Option<&str>
Only set for input elements, contains the input’s associated text value.
Sourcepub fn input_checked(&self) -> Option<bool>
pub fn input_checked(&self) -> Option<bool>
Only set for radio and checkbox input elements, indicates if the element has been checked
Sourcepub fn option_selected(&self) -> Option<bool>
pub fn option_selected(&self) -> Option<bool>
Only set for option elements, indicates if the element has been selected
Sourcepub fn backend_node_id(&self) -> &BackendNodeId
pub fn backend_node_id(&self) -> &BackendNodeId
‘Node’’s id, corresponds to DOM.Node.backendNodeId.
Sourcepub fn child_node_indexes(&self) -> Option<&[i64]>
pub fn child_node_indexes(&self) -> Option<&[i64]>
The indexes of the node’s child nodes in the ‘domNodes’ array returned by ‘getSnapshot’, if any.
Sourcepub fn attributes(&self) -> Option<&[NameValue<'a>]>
pub fn attributes(&self) -> Option<&[NameValue<'a>]>
Attributes of an ‘Element’ node.
Sourcepub fn pseudo_element_indexes(&self) -> Option<&[i64]>
pub fn pseudo_element_indexes(&self) -> Option<&[i64]>
Indexes of pseudo elements associated with this node in the ‘domNodes’ array returned by ‘getSnapshot’, if any.
Sourcepub fn layout_node_index(&self) -> Option<u64>
pub fn layout_node_index(&self) -> Option<u64>
The index of the node’s related layout tree node in the ‘layoutTreeNodes’ array returned by ‘getSnapshot’, if any.
Sourcepub fn document_url(&self) -> Option<&str>
pub fn document_url(&self) -> Option<&str>
Document URL that ‘Document’ or ‘FrameOwner’ node points to.
Sourcepub fn base_url(&self) -> Option<&str>
pub fn base_url(&self) -> Option<&str>
Base URL that ‘Document’ or ‘FrameOwner’ node uses for URL completion.
Sourcepub fn content_language(&self) -> Option<&str>
pub fn content_language(&self) -> Option<&str>
Only set for documents, contains the document’s content language.
Sourcepub fn document_encoding(&self) -> Option<&str>
pub fn document_encoding(&self) -> Option<&str>
Only set for documents, contains the document’s character set encoding.
Sourcepub fn frame_id(&self) -> Option<&FrameId<'a>>
pub fn frame_id(&self) -> Option<&FrameId<'a>>
Frame ID for frame owner elements and also for the document node.
Sourcepub fn content_document_index(&self) -> Option<u64>
pub fn content_document_index(&self) -> Option<u64>
The index of a frame owner element’s content document in the ‘domNodes’ array returned by ‘getSnapshot’, if any.
Sourcepub fn pseudo_type(&self) -> Option<&PseudoType>
pub fn pseudo_type(&self) -> Option<&PseudoType>
Type of a pseudo element node.
Sourcepub fn shadow_root_type(&self) -> Option<&ShadowRootType>
pub fn shadow_root_type(&self) -> Option<&ShadowRootType>
Shadow root type.
Sourcepub fn is_clickable(&self) -> Option<bool>
pub fn is_clickable(&self) -> Option<bool>
Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked.
Sourcepub fn event_listeners(&self) -> Option<&[EventListener<'a>]>
pub fn event_listeners(&self) -> Option<&[EventListener<'a>]>
Details of the node’s event listeners, if any.
Sourcepub fn current_source_url(&self) -> Option<&str>
pub fn current_source_url(&self) -> Option<&str>
The selected url for nodes with a srcset attribute.
Sourcepub fn origin_url(&self) -> Option<&str>
pub fn origin_url(&self) -> Option<&str>
The url of the script (if any) that generates this node.
Sourcepub fn scroll_offset_x(&self) -> Option<f64>
pub fn scroll_offset_x(&self) -> Option<f64>
Scroll offsets, set when this node is a Document.