Skip to main content

FocusTraversalCtx

Struct FocusTraversalCtx 

Source
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>

Source

pub fn store(&self) -> &'a NodeStore

Source

pub fn style_cascade(&self) -> &StyleCascade<'a, dyn ResponsivePatches + 'a>

Source

pub fn open_overlays(&self) -> &'a [ResolvedOverlay]

Source

pub fn resolved_overlay(&self, id: NodeId) -> Option<ResolvedOverlay>

Source

pub fn is_open_overlay(&self, id: NodeId) -> bool

Source

pub fn topmost_modal(&self) -> Option<NodeId>

Source

pub fn topmost_modal_index(&self) -> Option<usize>

Source

pub fn layout_of(&self, id: NodeId) -> Option<LayoutRect>

Source

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.

Source

pub fn viewport(&self) -> (f32, f32)

Source

pub fn is_focusable(&self, id: NodeId) -> bool

Canonical focusability check matching nativeview_engine::is_focusable_node.

Source

pub fn is_tabbable(&self, id: NodeId) -> bool

Canonical tabbability check: focusable and tab_index is absent or >= 0.

Source

pub fn is_in_active_scope(&self, id: NodeId) -> bool

Returns true when id is connected and not inert under the topmost open modal.

Source

pub fn scratch(&mut self) -> &mut FocusTraversalScratch

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for FocusTraversalCtx<'a>

§

impl<'a> !Send for FocusTraversalCtx<'a>

§

impl<'a> !Sync for FocusTraversalCtx<'a>

§

impl<'a> !UnwindSafe for FocusTraversalCtx<'a>

§

impl<'a> Forget for FocusTraversalCtx<'a>

§

impl<'a> Freeze for FocusTraversalCtx<'a>
where &'a NodeStore: Freeze, &'a dyn ResponsivePatches: Freeze, &'a InteractionTracker: Freeze, &'a OverlayState: Freeze, &'a dyn FocusLayoutLookup: Freeze, &'a mut FocusTraversalScratch: Freeze,

§

impl<'a> Move for FocusTraversalCtx<'a>

§

impl<'a> Unpin for FocusTraversalCtx<'a>
where &'a NodeStore: Unpin, &'a dyn ResponsivePatches: Unpin, &'a InteractionTracker: Unpin, &'a OverlayState: Unpin, &'a dyn FocusLayoutLookup: Unpin, &'a mut FocusTraversalScratch: Unpin,

§

impl<'a> UnsafeUnpin for FocusTraversalCtx<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.