Skip to main content

Module input_bidi

Module input_bidi 

Source
Expand description

WebDriver BiDi (Firefox) counterpart of crate::session::input.

Element refs on BiDi are integer ids in a page-side registry written by the snapshot walker (crate::dom::scripts::SNAPSHOT_TREE_JS). Geometry is computed in the page (REF_CENTER_JS, REF_CLIP_RECT_JS) and input is dispatched with input.performActions at viewport-origin CSS pixel coordinates, so no locateNodes / sharedId bookkeeping is needed. Typing goes through in-page execCommand('insertText') (with a value-setter fallback) because BiDi has no insertText; per-character key actions cover press_sequentially, and Enter is a key action.

Every helper returns SessionError::NodeGone when the registry no longer resolves the id, which the tool layer maps to StaleRef.

Functions§

accessibility_tree
Run the walker and parse its JSON.
click
Left-click the node’s centre.
document_size
Document scroll size, for full-page screenshots.
document_token
Per-document token (see DOC_TOKEN_JS).
drag
Pointer drag from one node’s centre to another’s.
hover
Move the pointer over the node’s centre.
node_center
Scroll the node into view and return its clickable centre.
node_clip_rect
Border box of the node in document coordinates.
type_text
Focus the node, replace its content with text, optionally one key at a time, and optionally press Enter.