pub struct FocusTraversalCtx<'a> { /* private fields */ }Expand description
Read-only scene view plus reusable scratch buffers passed to FocusTraversalPolicy::traverse.
Implementations§
Source§impl<'a> FocusTraversalCtx<'a>
impl<'a> FocusTraversalCtx<'a>
pub fn store(&self) -> &'a NodeStore
pub fn style_cascade(&self) -> &StyleCascade<'a, dyn ResponsivePatches + 'a>
pub fn open_overlays(&self) -> &'a [ResolvedOverlay]
pub fn resolved_overlay(&self, id: NodeId) -> Option<ResolvedOverlay>
pub fn is_open_overlay(&self, id: NodeId) -> bool
pub fn topmost_modal(&self) -> Option<NodeId>
pub fn topmost_modal_index(&self) -> Option<usize>
pub fn layout_of(&self, id: NodeId) -> Option<LayoutRect>
Sourcepub fn visual_rect_of(&self, id: NodeId) -> Option<LayoutRect>
pub fn visual_rect_of(&self, id: NodeId) -> Option<LayoutRect>
Viewport-space visual rectangle of id accounting for ancestor scroll offsets, sticky
clamping, 2D transforms, and hoisted open-overlay positioning.
pub fn viewport(&self) -> (f32, f32)
Sourcepub fn is_focusable(&self, id: NodeId) -> bool
pub fn is_focusable(&self, id: NodeId) -> bool
Canonical focusability check matching nativeview_engine::is_focusable_node.
Sourcepub fn is_tabbable(&self, id: NodeId) -> bool
pub fn is_tabbable(&self, id: NodeId) -> bool
Canonical tabbability check: focusable and tab_index is absent or >= 0.
Sourcepub fn is_in_active_scope(&self, id: NodeId) -> bool
pub fn is_in_active_scope(&self, id: NodeId) -> bool
Returns true when id is connected and not inert under the topmost open modal.
pub fn scratch(&mut self) -> &mut FocusTraversalScratch
Sourcepub fn visit_active_scope(
&mut self,
visit: impl FnMut(&NodeStore, NodeId, bool, Option<ResolvedOverlay>),
)
pub fn visit_active_scope( &mut self, visit: impl FnMut(&NodeStore, NodeId, bool, Option<ResolvedOverlay>), )
Walks every non-pruned node in the active focus scope in document pre-order, deduplicating
open overlay subtrees and propagating CSS-inherited visibility: hidden without pruning
visibility: hidden subtrees (so visibility: visible descendants remain reachable).
Passes (store, node_id, effectively_hidden, containing_open_overlay) to visit.
Sourcepub fn visit_active_scope_focusables(
&mut self,
visit: impl FnMut(NodeId, Option<LayoutRect>),
)
pub fn visit_active_scope_focusables( &mut self, visit: impl FnMut(NodeId, Option<LayoutRect>), )
Walks every focusable, non-hidden node in the active focus scope in document pre-order,
passing (node_id, viewport_rect) resolved via LaidOutScene::visual_rect_of (scroll
offsets, sticky clamping, 2D transforms, and hoisted open overlays). Zero heap allocations
once scratch buffers are warm.