Skip to content

Commit

Permalink
fix(focus-order-semantics): Add ARIA role article to list of valid ro…
Browse files Browse the repository at this point in the history
…les for scrollable regions (#3927)

* Pending changes exported from your codespace

* Un-commenting article role

* Adding rule test for focus-order-semantics
  • Loading branch information
philipjia123 authored Mar 7, 2023
1 parent 66f23e5 commit f029271
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/checks/aria/valid-scrollable-semantics-evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = {
*/
const VALID_ROLES_FOR_SCROLLABLE_REGIONS = {
application: true,
article: true,
banner: false,
complementary: true,
contentinfo: true,
Expand Down
12 changes: 12 additions & 0 deletions test/checks/aria/valid-scrollable-semantics.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ describe('valid-scrollable-semantics', function () {
);
});

it('should return true for role=article', function () {
var node = document.createElement('div');
node.setAttribute('role', 'article');
fixture.appendChild(node);
flatTreeSetup(fixture);
assert.isTrue(
axe.testUtils
.getCheckEvaluate('valid-scrollable-semantics')
.call(checkContext, node)
);
});

it('should return true for nav elements', function () {
var node = document.createElement('nav');
fixture.appendChild(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h4>Valid landmark roles for scrollable containers</h4>
<div id="pass7" role="region" tabindex="0"></div>
<div id="pass8" role="application" tabindex="0"></div>
<div id="pass9" role="tooltip" tabindex="0"></div>
<div id="pass10" role="article" tabindex="0"></div>
</div>
<h4>
Valid scrollable HTML tags for scrollable regions, not selected by this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
["#pass6"],
["#pass7"],
["#pass8"],
["#pass9"]
["#pass9"],
["#pass10"]
],
"violations": [
["#violation1"],
Expand Down

0 comments on commit f029271

Please sign in to comment.