Skip to content

Commit

Permalink
fix(aria-allowed-role): add gridcell, separator, slider and treeitem …
Browse files Browse the repository at this point in the history
…to allowed roles of button element (#4398)

Closes: #4397
  • Loading branch information
msereniti committed Apr 5, 2024
1 parent 105016c commit 4788bf8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 5 additions & 1 deletion lib/standards/html-elms.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,18 @@ const htmlElms = {
allowedRoles: [
'checkbox',
'combobox',
'gridcell',
'link',
'menuitem',
'menuitemcheckbox',
'menuitemradio',
'option',
'radio',
'separator',
'slider',
'switch',
'tab'
'tab',
'treeitem'
],
// 5.4 button Element
namingMethods: ['subtreeText']
Expand Down
13 changes: 7 additions & 6 deletions test/integration/rules/aria-allowed-role/aria-allowed-role.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ <h1 id="pass-h1-valid-role" role="none"></h1>
></div>
<div id="pass-graphics-object" role="graphics-object"></div>
<div id="pass-graphics-symbol" role="graphics-symbol"></div>
<button
id="pass-button-role-gridcell"
role="gridcell"
title="IconCheckmark"
aria-label="IconCheckmark icon"
></button>

<dd id="fail-dd-no-role" role="link"></dd>
<dt id="fail-dt-no-role" role="banner"></dt>
Expand All @@ -219,12 +225,7 @@ <h1 id="pass-h1-valid-role" role="none"></h1>
<button id="fail-button-role-cell" role="cell"></button>
<aside id="fail-aside-doc-foreword" role="doc-foreword"></aside>
<aside id="fail-aside-role-tab" role="tab"></aside>
<button
id="fail-button-role-gridcell"
role="gridcell"
title="IconCheckmark"
aria-label="IconCheckmark icon"
></button>

<input id="fail-input-role-gridcell-multiple-role" role="gridcell combobox" />
<div style="display: none">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
["#pass-imgmap-2"],
["#pass-navnone-1"],
["#pass-navnone-2"],
["#pass-search-elm"]
["#pass-search-elm"],
["#pass-button-role-gridcell"]
],
"violations": [
["#fail-dd-no-role"],
Expand All @@ -102,7 +103,6 @@
["#fail-button-role-cell"],
["#fail-aside-doc-foreword"],
["#fail-aside-role-tab"],
["#fail-button-role-gridcell"],
["#fail-input-role-gridcell-multiple-role"],
["#fail-dpub-1"],
["#fail-dpub-2"],
Expand Down

0 comments on commit 4788bf8

Please sign in to comment.