Skip to content

Commit 4788bf8

Browse files
authored
fix(aria-allowed-role): add gridcell, separator, slider and treeitem to allowed roles of button element (#4398)
Closes: #4397
1 parent 105016c commit 4788bf8

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

lib/standards/html-elms.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,18 @@ const htmlElms = {
140140
allowedRoles: [
141141
'checkbox',
142142
'combobox',
143+
'gridcell',
143144
'link',
144145
'menuitem',
145146
'menuitemcheckbox',
146147
'menuitemradio',
147148
'option',
148149
'radio',
150+
'separator',
151+
'slider',
149152
'switch',
150-
'tab'
153+
'tab',
154+
'treeitem'
151155
],
152156
// 5.4 button Element
153157
namingMethods: ['subtreeText']

test/integration/rules/aria-allowed-role/aria-allowed-role.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ <h1 id="pass-h1-valid-role" role="none"></h1>
207207
></div>
208208
<div id="pass-graphics-object" role="graphics-object"></div>
209209
<div id="pass-graphics-symbol" role="graphics-symbol"></div>
210+
<button
211+
id="pass-button-role-gridcell"
212+
role="gridcell"
213+
title="IconCheckmark"
214+
aria-label="IconCheckmark icon"
215+
></button>
210216

211217
<dd id="fail-dd-no-role" role="link"></dd>
212218
<dt id="fail-dt-no-role" role="banner"></dt>
@@ -219,12 +225,7 @@ <h1 id="pass-h1-valid-role" role="none"></h1>
219225
<button id="fail-button-role-cell" role="cell"></button>
220226
<aside id="fail-aside-doc-foreword" role="doc-foreword"></aside>
221227
<aside id="fail-aside-role-tab" role="tab"></aside>
222-
<button
223-
id="fail-button-role-gridcell"
224-
role="gridcell"
225-
title="IconCheckmark"
226-
aria-label="IconCheckmark icon"
227-
></button>
228+
228229
<input id="fail-input-role-gridcell-multiple-role" role="gridcell combobox" />
229230
<div style="display: none">
230231
<button

test/integration/rules/aria-allowed-role/aria-allowed-role.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
["#pass-imgmap-2"],
8989
["#pass-navnone-1"],
9090
["#pass-navnone-2"],
91-
["#pass-search-elm"]
91+
["#pass-search-elm"],
92+
["#pass-button-role-gridcell"]
9293
],
9394
"violations": [
9495
["#fail-dd-no-role"],
@@ -102,7 +103,6 @@
102103
["#fail-button-role-cell"],
103104
["#fail-aside-doc-foreword"],
104105
["#fail-aside-role-tab"],
105-
["#fail-button-role-gridcell"],
106106
["#fail-input-role-gridcell-multiple-role"],
107107
["#fail-dpub-1"],
108108
["#fail-dpub-2"],

0 commit comments

Comments
 (0)