Skip to content

Commit

Permalink
feat: Make aria-level required with role=heading #740
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers committed Mar 1, 2018
1 parent 5a45a5c commit 695dd85
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/commons/aria/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ lookupTable.role = {
'heading': {
type: 'structure',
attributes: {
allowed: ['aria-level', 'aria-expanded']
required: ['aria-level'],
allowed: ['aria-expanded']
},
owned: null,
nameFrom: ['author', 'contents'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/rules/aria-allowed-attr/passes.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<div role="group" id="pass20" 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="heading" id="pass21" aria-level="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="heading" id="pass21" 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="img" id="pass22" 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
2 changes: 2 additions & 0 deletions test/integration/rules/aria-required-attr/required-attr.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<div role="scrollbar" id="pass1" aria-controls="value" aria-orientation="value" aria-valuenow="value" aria-valuemax="value" aria-valuemin="value">ok</div>
<div role="slider" id="pass2" aria-valuenow="value" aria-valuemax="value" aria-valuemin="value">ok</div>
<div role="spinbutton" id="pass3" aria-valuenow="value" aria-valuemax="value" aria-valuemin="value">ok</div>
<div role="heading" id="pass4" aria-level="1">ok</div>

<div role="scrollbar" id="violation1">fail</div>
<div role="slider" id="violation2">fail</div>
<div role="spinbutton" id="violation3">fail</div>
<div role="heading" id="violation4">fail</div>
4 changes: 2 additions & 2 deletions test/integration/rules/aria-required-attr/required-attr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"description": "aria-required-attr tests",
"rule": "aria-required-attr",
"violations": [
["#violation1"], ["#violation2"], ["#violation3"]
["#violation1"], ["#violation2"], ["#violation3"], ["#violation4"]
],
"passes": [
["#pass1"], ["#pass2"], ["#pass3"]
["#pass1"], ["#pass2"], ["#pass3"], ["#pass4"]
]
}

0 comments on commit 695dd85

Please sign in to comment.