Skip to content

Commit

Permalink
Additional ARIA 1.1. support and tests (#509)
Browse files Browse the repository at this point in the history
* feat(ARIA 1.1): Allow row-index, setsize and posinset on more roles

* test(aria): aria-haspopup, aria-modal for 1.1

* style(test/aria): add line breaks for readability

* test(aria): add missing roles and properties
  • Loading branch information
marcysutton authored and Marcy Sutton committed Sep 6, 2017
1 parent ff3df2d commit 9b4d2ee
Show file tree
Hide file tree
Showing 9 changed files with 369 additions and 282 deletions.
12 changes: 7 additions & 5 deletions lib/commons/aria/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ lookupTables.role = {
'article': {
type: 'structure',
attributes: {
allowed: ['aria-expanded']
allowed: ['aria-expanded', 'aria-posinset', 'aria-setsize']
},
owned: null,
nameFrom: ['author'],
Expand Down Expand Up @@ -523,7 +523,9 @@ lookupTables.role = {
},
'menuitem': {
type: 'widget',
attributes: null,
attributes: {
allowed: ['aria-posinset', 'aria-setsize']
},
owned: null,
nameFrom: ['author', 'contents'],
context: ['menu', 'menubar'],
Expand All @@ -532,7 +534,7 @@ lookupTables.role = {
'menuitemcheckbox': {
type: 'widget',
attributes: {
allowed: ['aria-checked']
allowed: ['aria-checked', 'aria-posinset', 'aria-setsize']
},
owned: null,
nameFrom: ['author', 'contents'],
Expand Down Expand Up @@ -643,7 +645,7 @@ lookupTables.role = {
'row': {
type: 'structure',
attributes: {
allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowcount']
allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowcount', 'aria-rowindex']
},
owned: {
one: ['cell', 'columnheader', 'rowheader', 'gridcell']
Expand Down Expand Up @@ -773,7 +775,7 @@ lookupTables.role = {
'tab': {
type: 'widget',
attributes: {
allowed: ['aria-selected', 'aria-expanded']
allowed: ['aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset']
},
owned: null,
nameFrom: ['author', 'contents'],
Expand Down
200 changes: 135 additions & 65 deletions test/integration/rules/aria-allowed-attr/passes.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/integration/rules/aria-allowed-attr/passes.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
["#pass43"], ["#pass44"], ["#pass45"], ["#pass46"], ["#pass47"], ["#pass48"], ["#pass49"],
["#pass50"], ["#pass51"], ["#pass52"], ["#pass53"], ["#pass54"], ["#pass55"], ["#pass56"],
["#pass57"], ["#pass58"], ["#pass59"], ["#pass60"], ["#pass61"], ["#pass62"], ["#pass63"],
["#pass64"], ["#pass65"]
["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"]
]
}
106 changes: 54 additions & 52 deletions test/integration/rules/aria-roles/aria-roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,60 @@
<div role="dialog" id="pass13">ok</div>
<div role="directory" id="pass14">ok</div>
<div role="document" id="pass15">ok</div>
<div role="form" id="pass16">ok</div>
<div role="grid" id="pass17">ok</div>
<div role="gridcell" id="pass18">ok</div>
<div role="group" id="pass19">ok</div>
<div role="heading" id="pass20">ok</div>
<div role="img" id="pass21">ok</div>
<div role="link" id="pass22">ok</div>
<div role="list" id="pass23">ok</div>
<div role="listbox" id="pass24">ok</div>
<div role="listitem" id="pass25">ok</div>
<div role="log" id="pass26">ok</div>
<div role="main" id="pass27">ok</div>
<div role="marquee" id="pass28">ok</div>
<div role="math" id="pass29">ok</div>
<div role="menu" id="pass30">ok</div>
<div role="menubar" id="pass31">ok</div>
<div role="menuitem" id="pass32">ok</div>
<div role="menuitemcheckbox" id="pass33">ok</div>
<div role="menuitemradio" id="pass34">ok</div>
<div role="navigation" id="pass35">ok</div>
<div role="note" id="pass36">ok</div>
<div role="option" id="pass37">ok</div>
<div role="presentation" id="pass38">ok</div>
<div role="progressbar" id="pass39">ok</div>
<div role="radio" id="pass40">ok</div>
<div role="radiogroup" id="pass41">ok</div>
<div role="region" id="pass42">ok</div>
<div role="row" id="pass43">ok</div>
<div role="rowgroup" id="pass44">ok</div>
<div role="rowheader" id="pass45">ok</div>
<div role="scrollbar" id="pass46">ok</div>
<div role="search" id="pass47">ok</div>
<div role="separator" id="pass48">ok</div>
<div role="slider" id="pass49">ok</div>
<div role="spinbutton" id="pass50">ok</div>
<div role="status" id="pass51">ok</div>
<div role="tab" id="pass52">ok</div>
<div role="tablist" id="pass53">ok</div>
<div role="tabpanel" id="pass54">ok</div>
<div role="textbox" id="pass55">ok</div>
<div role="timer" id="pass56">ok</div>
<div role="toolbar" id="pass57">ok</div>
<div role="tooltip" id="pass58">ok</div>
<div role="tree" id="pass59">ok</div>
<div role="treegrid" id="pass60">ok</div>
<div role="treeitem" id="pass61">ok</div>
<div role="switch" id="pass62">ok</div>
<div role="none" id="pass63">ok</div>
<div role="cell" id="pass64">ok</div>
<div role="searchbox" id="pass65">ok</div>
<div role="text" id="pass66">ok</div>
<div role="table" id="pass67">ok</div>
<div role="feed" id="pass16">ok</div>
<div role="form" id="pass17">ok</div>
<div role="grid" id="pass18">ok</div>
<div role="gridcell" id="pass19">ok</div>
<div role="group" id="pass20">ok</div>
<div role="heading" id="pass21">ok</div>
<div role="img" id="pass22">ok</div>
<div role="link" id="pass23">ok</div>
<div role="list" id="pass24">ok</div>
<div role="listbox" id="pass25">ok</div>
<div role="listitem" id="pass26">ok</div>
<div role="log" id="pass27">ok</div>
<div role="main" id="pass28">ok</div>
<div role="marquee" id="pass29">ok</div>
<div role="math" id="pass30">ok</div>
<div role="menu" id="pass31">ok</div>
<div role="menubar" id="pass32">ok</div>
<div role="menuitem" id="pass33">ok</div>
<div role="menuitemcheckbox" id="pass34">ok</div>
<div role="menuitemradio" id="pass35">ok</div>
<div role="navigation" id="pass36">ok</div>
<div role="note" id="pass37">ok</div>
<div role="option" id="pass38">ok</div>
<div role="presentation" id="pass39">ok</div>
<div role="progressbar" id="pass40">ok</div>
<div role="radio" id="pass41">ok</div>
<div role="radiogroup" id="pass42">ok</div>
<div role="region" id="pass43">ok</div>
<div role="row" id="pass44">ok</div>
<div role="rowgroup" id="pass45">ok</div>
<div role="rowheader" id="pass46">ok</div>
<div role="scrollbar" id="pass47">ok</div>
<div role="search" id="pass48">ok</div>
<div role="separator" id="pass49">ok</div>
<div role="slider" id="pass50">ok</div>
<div role="spinbutton" id="pass51">ok</div>
<div role="status" id="pass52">ok</div>
<div role="tab" id="pass53">ok</div>
<div role="tablist" id="pass54">ok</div>
<div role="tabpanel" id="pass55">ok</div>
<div role="term" id="pass56">ok</div>
<div role="textbox" id="pass57">ok</div>
<div role="timer" id="pass58">ok</div>
<div role="toolbar" id="pass59">ok</div>
<div role="tooltip" id="pass60">ok</div>
<div role="tree" id="pass61">ok</div>
<div role="treegrid" id="pass62">ok</div>
<div role="treeitem" id="pass63">ok</div>
<div role="switch" id="pass64">ok</div>
<div role="none" id="pass65">ok</div>
<div role="cell" id="pass66">ok</div>
<div role="searchbox" id="pass67">ok</div>
<div role="text" id="pass68">ok</div>
<div role="table" id="pass69">ok</div>
</div>
<div id="violation">
<!-- abstract roles -->
Expand Down
2 changes: 1 addition & 1 deletion test/integration/rules/aria-roles/aria-roles.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
["#pass43"], ["#pass44"], ["#pass45"], ["#pass46"], ["#pass47"], ["#pass48"], ["#pass49"],
["#pass50"], ["#pass51"], ["#pass52"], ["#pass53"], ["#pass54"], ["#pass55"], ["#pass56"],
["#pass57"], ["#pass58"], ["#pass59"], ["#pass60"], ["#pass61"], ["#pass62"], ["#pass63"],
["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"]
["#pass64"], ["#pass65"], ["#pass66"], ["#pass67"], ["#pass68"], ["#pass69"]
]
}
Loading

0 comments on commit 9b4d2ee

Please sign in to comment.