Skip to content

module

a11y

The semantic layer: an accessibility tree computed from the virtual tree.

  • DSL elements (button, heading…) and plain HTML tags (h2, nav, header, input type=range, dialog, table…) map to ARIA roles; an explicit role attribute wins.
  • Names follow the accessible-name algorithm (simplified): aria-labelledby → label/aria-label → <label for> → alt → content (for roles named from content) → placeholder → title.
  • ARIA states (aria-expanded, aria-selected, aria-pressed, aria-checked, aria-current, aria-modal, value attributes) are captured; hidden, inert and aria-hidden="true" subtrees are excluded.
  • Layout containers (column, div…) are presentational and flattened.
  • Graphics surfaces become figures whose labelled shapes / 3D objects are exposed as children with screen-space bounds, so canvas content is reachable by screen readers and keyboard (hosts render these as proxy elements over the canvas).

Structs

Enums

  • Role

    What an element is to assistive technology: its ARIA role ([Role::aria] names it).

Functions

accessible_name

pub fn accessible_name(el: &VElement) -> Option<String>

Accessible name of an element considered on its own (without id references to the rest of the tree).

all_roles

pub fn all_roles() -> &'static [Role]

Every role, in declaration order.

aria_attributes

pub fn aria_attributes(el: &VElement) -> Vec<(String, String)>

ARIA attributes a host should set on an element's DOM node.

audit

pub fn audit(tree: &AccessNode) -> Vec<Issue>

Check the tree for missing names and skipped heading levels.

audit_graphics

pub fn audit_graphics(roots: &[VNode]) -> Vec<Issue>

Report interactive graphics items with no label (they'd be unreachable).

build_tree

pub fn build_tree(roots: &[VNode]) -> AccessNode

Build the accessibility tree for a rendered root list.

graphic_children

pub fn graphic_children(el: &VElement, path: &[usize]) -> Vec<AccessNode>

Accessibility nodes for the labelled items of a graphics surface at path.

role_for

pub fn role_for(el: &VElement) -> Option<Role>

The role of an element (None = presentational / generic).