Skip to content

Commit

Permalink
fix(aria-allowed-attr): align rowcount, colcount, and colindex with 1…
Browse files Browse the repository at this point in the history
….1 spec (#555)

Allow aria-rowcount and aria-colcount on role=grid; disallow the same on role=row; allow aria-colindex on role=row

#547
  • Loading branch information
isner authored and marcysutton committed Dec 12, 2017
1 parent 6457ba4 commit 320ef55
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
14 changes: 8 additions & 6 deletions lib/commons/aria/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ lookupTables.role = {
'columnheader': {
type: 'structure',
attributes: {
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort']
},
owned: null,
Expand Down Expand Up @@ -344,7 +344,7 @@ lookupTables.role = {
attributes: {
allowed: ['aria-expanded']
},
owned: {
owned: {
one: ['article']
},
nameFrom: ['author'],
Expand All @@ -363,7 +363,8 @@ lookupTables.role = {
'grid': {
type: 'composite',
attributes: {
allowed: ['aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-activedescendant', 'aria-expanded']
allowed: ['aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level',
'aria-multiselectable', 'aria-readonly', 'aria-rowcount']
},
owned: {
one: ['rowgroup', 'row']
Expand All @@ -375,7 +376,7 @@ lookupTables.role = {
'gridcell': {
type: 'widget',
attributes: {
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex',
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex',
'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required']
},
owned: null,
Expand Down Expand Up @@ -648,7 +649,8 @@ lookupTables.role = {
'row': {
type: 'structure',
attributes: {
allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowcount', 'aria-rowindex']
allowed: ['aria-activedescendant', 'aria-colindex', 'aria-expanded',
'aria-level', 'aria-selected', 'aria-rowindex']
},
owned: {
one: ['cell', 'columnheader', 'rowheader', 'gridcell']
Expand All @@ -672,7 +674,7 @@ lookupTables.role = {
'rowheader': {
type: 'structure',
attributes: {
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort']
},
owned: null,
Expand Down
2 changes: 2 additions & 0 deletions test/integration/rules/aria-allowed-attr/failures.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<div role="alert" aria-selected="true" id="fail1">fail</div>
<div role="link" aria-selected="true" id="fail2">fail</div>
<div role="row" aria-colcount="value" id="fail3">fail</div>
<div role="row" aria-rowcount="value" id="fail4">fail</div>
4 changes: 2 additions & 2 deletions test/integration/rules/aria-allowed-attr/failures.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"description": "aria-allowed-attr failing tests",
"rule": "aria-allowed-attr",
"violations": [
["#fail1"], ["#fail2"]
["#fail1"], ["#fail2"], ["#fail3"], ["#fail4"]
]
}
}
4 changes: 2 additions & 2 deletions test/integration/rules/aria-allowed-attr/passes.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<div role="form" id="pass17" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>

<div role="grid" id="pass18" aria-level="value" aria-multiselectable="value" aria-readonly="value" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
<div role="grid" id="pass18" aria-level="value" aria-multiselectable="value" aria-readonly="value" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value" aria-colcount="value" aria-rowcount="value">ok</div>

<div role="gridcell" id="pass19" aria-colindex="value" aria-colspan="value" aria-rowindex="value" aria-rowspan="value" aria-selected="value" aria-readonly="value" aria-expanded="value" aria-required="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>

Expand Down Expand Up @@ -85,7 +85,7 @@

<div role="region" id="pass42" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>

<div role="row" id="pass43" aria-colcount="value" aria-rowcount="value" aria-rowindex="value" aria-level="value" aria-selected="value" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>
<div role="row" id="pass43" aria-colindex="value" aria-rowindex="value" aria-level="value" aria-selected="value" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>

<div role="rowgroup" id="pass44" aria-activedescendant="value" aria-expanded="value" aria-atomic="value" aria-busy="value" aria-controls="value" aria-describedby="value" aria-disabled="value" aria-dropeffect="value" aria-flowto="value" aria-grabbed="value" aria-haspopup="value" aria-hidden="value" aria-invalid="value" aria-keyshortcuts="value" aria-label="value" aria-labelledby="value" aria-live="value" aria-owns="value" aria-relevant="value">ok</div>

Expand Down

0 comments on commit 320ef55

Please sign in to comment.