Skip to main content

Module element

Module element 

Source
Expand description

Element actions: revalidation, the perform allowlist, and secure-field refusal.

Nothing here calls a platform API. The macOS backend and [crate::test_backend] both ask this module whether an action may run, then record or perform it.

Structs§

ElementError
Failure that may carry the fresh tree for stale_element.
ElementOutcome
Successful element action, before it is rendered as JSON.
ElementPeek
Cached title and secure bit used by the confirm hook before an element action.
ElementRequest
Shared fields for one element command.
Gate
Revalidation succeeded. The backend may read settable or character count next.
GateInput
Inputs gate needs. The live node is the re-fetched tree.
HitInfo
Role and title of the element under a coordinate, when hit-testing finds one.

Enums§

ElementOp
What the caller asked to do to one element index.
Step
One step the backend performs after gate allows it.

Constants§

FRAME_TOLERANCE
Each edge may differ by this many screen points and still be the same element.
PERFORM_ALLOWLIST
AXUIElementPerformAction names perform_action accepts.
REFRESH_HINT
Hint included on element_not_found and stale_element.

Functions§

activate_outcome
Outcome for an action that the activate tier performed.
find_path
Child-index path of preorder index in a cached signature.
frame_outside
True when element is not fully inside window.
frames_match
True when every edge is within FRAME_TOLERANCE. Missing frames match only each other.
gate
Decide whether the action may run.
outcome
Success value shared by the macOS backend and the stub.
press_route
Left press stays AXPress. Right uses AXShowMenu when that action is advertised. Every other button, and a right press without a menu, clicks the element center through the input tiers.
refresh_hint
Refresh hint. A known app name replaces the literal X.
require_action
execution_failed listing the actions CopyActionNames returned.
steps
Build the steps that run after settable and character-count reads.
ui_at_path
Live node at a child-index path. An empty path is the root.
validate_count
count must be 1, 2, or 3.
validate_perform_name
Refuse names outside PERFORM_ALLOWLIST.
validate_range
start <= end, both non-negative, and end within char_count when it was read.
validate_text
Empty text is refused when empty_ok is false. A null byte is always refused.