✅ The extends: 'recommended'
property in a configuration file enables this rule.
The required context role defines the owning container where this role is allowed. If a role has a required context, authors MUST ensure that an element with the role is contained inside (or owned by) an element with the required context role. For example, an element with role="listitem"
is only meaningful when contained inside (or owned by) an element with role="list"
.
Format: role | required context role
- columnheader | row
- gridcell | row
- listitem | group or list
- menuitem | group, menu, or menubar
- menuitemcheckbox | menu or menubar
- menuitemradio | group, menu, or menubar
- option | listbox
- row | grid, rowgroup, or treegrid
- rowgroup | grid
- rowheader | row
- tab | tablist
- treeitem | group or tree
This rule allows the following:
This rule forbids the following:
- https://www.w3.org/TR/wai-aria-1.1/#scope
- https://www.w3.org/TR/wai-aria-1.1/#columnheader
- https://www.w3.org/TR/wai-aria-1.1/#gridcell
- https://www.w3.org/TR/wai-aria-1.1/#listitem
- https://www.w3.org/TR/wai-aria-1.1/#menuitem
- https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox
- https://www.w3.org/TR/wai-aria-1.1/#menuitemradio
- https://www.w3.org/TR/wai-aria-1.1/#option
- https://www.w3.org/TR/wai-aria-1.1/#row
- https://www.w3.org/TR/wai-aria-1.1/#rowgroup
- https://www.w3.org/TR/wai-aria-1.1/#rowheader
- https://www.w3.org/TR/wai-aria-1.1/#tab
- https://www.w3.org/TR/wai-aria-1.1/#treeitem