pub enum Role {
Show 19 variants
Button,
Text,
Image,
Slider,
Alert,
Dialog,
Checkbox,
Radio,
Switch,
TextInput,
MenuItem,
ProgressBar,
Link,
Heading,
List,
ListItem,
Tab,
TabPanel,
Unknown,
}Expand description
The ARIA-style role of a semantic node in the accessibility tree.
This is the one source of truth for role data flowing through
RenderTree::collect_semantics() — used both for assistive tech (D099)
and, from D107/Phase 25 on, for mapping to real HTML tags (<h1>-<h6>,
<a>, <ul>/<li>, …) for SEO/crawler-facing output. Deliberately
NOT unified with the separate, richer rosace_a11y::role::Role — that
one drives rosace-a11y’s own internal focus-management tree, a
different concern (focus navigation, not HTML/SEO structure); merging
them would touch already-working, unrelated code for no benefit this
phase actually needs. Link/Heading/List/ListItem/Tab/
TabPanel/Radio added here specifically for the HTML mapping Phase 25
needs (a heading’s level and a link’s href live on SemanticNode/
Semantics directly, not on the enum, since they’re per-instance data,
not part of what kind of role it is). Radio is distinct from
Checkbox — real ARIA/HTML (role="radio" vs role="checkbox")
distinguishes mutually-exclusive single-select from independent
toggles; approximating one as the other would be wrong, not just
imprecise, so it earns its own variant rather than reusing Checkbox.