Skip to content

AccessKit relations set from draw closures can name nodes absent from the tree (adapter unwrap panic) #387

Open

Description

@samitbasu

From #381's work: AccessKit's platform adapters unwrap every node a relation names, so a relation pointing at a node that isn't in that frame's tree (a closed region, an unbuilt lazy panel) panics inside the adapter. That's a library-caused crash in native builds with accessibility on (#279's no-panics rule).

#381 adds NodeHandle::controls(Id) safely: relations are collected during the walk and announced after the pass, only when both ends are in the tree.

Two relations on main use the unsafe shape:

  • src/draw.rs:~2314 label_for: push_labelled_by(label) written through accesskit_node_builder(control, ..) from a draw closure. If the control isn't built that frame, this names a missing node.
  • src/vlist.rs:~603 set_active_descendant(row): the row is drawn in the same closure, so it's probably safe, but it should go through the same mechanism.

Fix: route every relation (labelled_by, described_by, controls, active_descendant, member_of, …) through #381's collected-after-the-pass path, and add a test per relation with a missing target.

Found by the #350 and #346 work.

Activity

  1. added
    bug
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions