Skip to main content

resolve_node_id

Function resolve_node_id 

pub fn resolve_node_id<S>(
    root: &dyn Widget,
    node_map: &HashMap<NodeId, *mut dyn Widget, S>,
    id: NodeId,
) -> Option<A11yTarget>
where S: BuildHasher,
Expand description

Invert an accesskit::NodeId back to the thing it addresses, by re-deriving ids over the current widget tree.

Returns None when the id belongs to no node this frame — a reference an assistive technology kept across a structural change. Callers must treat that as “gone”, never as a fallback to some other node: silently retargeting a stale id is how an AT ends up deleting the wrong clip. The same goes for a widget that was never laid out, and for a synthetic node owned by one: with no taffy id there is no handle to dispatch against.

A text run resolves to the field that owns it — the run is the widget’s text, so a verb aimed at it means the widget.