You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/template-require-context-role.md
+43-62Lines changed: 43 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,9 @@
2
2
3
3
<!-- end auto-generated rule header -->
4
4
5
-
Requires certain ARIA roles to be used in appropriate context.
6
-
7
-
Some ARIA roles must be contained within specific parent roles to be meaningful and accessible. For example, a `role="listitem"` must be inside an element with `role="list"`.
8
-
9
-
## Rule Details
10
-
11
-
This rule checks that context-dependent ARIA roles are used within the appropriate parent roles.
12
-
13
-
Roles requiring context:
5
+
## `<* role><* role /></*>`
14
6
15
-
-`listitem` → must be in `list`
16
-
-`option` → must be in `listbox`
17
-
-`tab` → must be in `tablist`
18
-
-`menuitem`, `menuitemcheckbox`, `menuitemradio` → must be in `menu` or `menubar`
19
-
-`treeitem` → must be in `tree`
20
-
-`row` → must be in `table`, `grid`, `treegrid`, or `rowgroup`
21
-
- And more...
7
+
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"`. You may place intermediate elements with `role="presentation"` or `role="none"` to remove their semantic meaning.
22
8
23
9
## Roles to check
24
10
@@ -37,65 +23,60 @@ Format: role | required context role
37
23
- tab | tablist
38
24
- treeitem | group or tree
39
25
40
-
## `<* role><* role /></*>`
41
-
42
-
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"`. You may place intermediate elements with `role="presentation"` or `role="none"` to remove their semantic meaning.
0 commit comments