Skip to main content

Module focus

Module focus 

Source
Expand description

Unified, zero-allocation focusability, modal tracking, and deterministic unmount focus recovery over &NodeStore, shared across LaidOutScene (Skia/Headless) and WebBackend.

Re-exports§

pub use crate::focus_query::first_focusable_in_subtree;
pub use crate::focus_query::first_matching_in_subtree;
pub use crate::focus_query::is_composite_aria_group;
pub use crate::focus_query::is_focusable_node;
pub use crate::focus_query::is_focusable_self;
pub use crate::focus_query::is_subtree_disabled;
pub use crate::focus_query::is_tabbable_self;
pub use crate::focus_query::is_text_entry_node;

Structs§

FocusAnchor
Snapshot of the currently focused node’s structural context used to recover focus deterministically when the focused node (or any ancestor wrapper) unmounts, hides, disables, or exits a modal.

Enums§

FocusRecoveryResult
Outcome of post-commit focus reconciliation.

Functions§

is_subtree_closed_overlay
Returns true when id or any ancestor owns a closed Overlay row.
is_within_subtree
Returns true when node equals ancestor or descends from ancestor.
resolve_focus_recovery
Resolves deterministic focus recovery after a committed NodeStore mutation (zero allocs).
snapshot_focus_anchor
Captures focused’s sibling handles, ancestor (parent, child_index) trail, composite ARIA group, and active modal into anchor (zero steady-state allocations).
topmost_open_modal
Finds the topmost (last in document order) open modal Overlay in the top layer (zero allocs on a warm dfs_scratch). The single definition ([INV:top-layer-single-definition]) shared by focus management, semantic queries, and — through TopLayerIndex, which applies walk_top_layer_chain with the same oracle and document order — layout, hit-testing, scroll latching and accessibility.