Commit dc20a4b
committed
fix(template-require-mandatory-role-attributes): skip abstract roles in fallback walk (Copilot review)
ARIA §5.3 marks certain roles as 'Abstract' — widget, input, command,
section, landmark, etc. — as ontology categories that must not be used
in content. Per §4.1 role-fallback semantics, UAs skip these in the
fallback resolution. Our previous impl treated any roles.get() hit as
recognised, so role='widget button' resolved to 'widget' and bailed
without checking button's required attrs (silent false negative).
Now filter roleDefinition.abstract alongside the existing undefined
check; aligns with sibling rules that already apply this filter.1 parent 3d69b55 commit dc20a4b
2 files changed
Lines changed: 21 additions & 1 deletion
File tree
- lib/rules
- tests/lib/rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
| |||
0 commit comments