Skip to content

Commit

Permalink
fix(aria-required-children): allow menu and menubar to be empty (#3770)
Browse files Browse the repository at this point in the history
  • Loading branch information
straker authored Nov 4, 2022
1 parent b1f0c6b commit d11aed8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 2 additions & 0 deletions lib/checks/aria/aria-required-children.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"grid",
"list",
"listbox",
"menu",
"menubar",
"table",
"tablist",
"tree",
Expand Down
2 changes: 1 addition & 1 deletion test/checks/aria/required-children.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ describe('aria-required-children', function () {
});

it('should not throw when options is incorrect', function () {
var params = checkSetup('<div role="menu" id="target"></div>');
var params = checkSetup('<div role="row" id="target"></div>');

// Options: (incorrect)
params[1] = ['menu'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
<div role="menuitem" id="ignore3"></div>
</div>
<div role="list" id="fail2" aria-owns="ingore4"></div>
<div role="menu" id="fail3"></div>
<div role="menubar" id="fail4"></div>
<div role="row" id="fail5"></div>
<div role="row" id="fail3"></div>
<div role="menuitem" id="ingore4"></div>
<div role="list" id="pass3" aria-owns="parent"></div>
<div id="parent">
Expand All @@ -26,13 +24,15 @@
<div role="listbox" id="incomplete9">
<div></div>
</div>
<div role="list" id="fail6">
<div role="menu" id="incomplete10"></div>
<div role="menubar" id="incomplete11"></div>
<div role="list" id="fail4">
<div role="tabpanel" id="ignore6">
<div role="listitem" id="ignore7">List item 1</div>
</div>
</div>
<div role="grid" id="pass4">
<div role="row" id="fail7">
<div role="row" id="fail5">
<span>Item 1</span>
</div>
</div>
Expand All @@ -59,7 +59,7 @@
<span role="insertion">option</span>
</div>

<div role="suggestion" id="fail8"></div>
<div role="suggestion" id="fail6"></div>

<div role="listbox" id="pass9">
<div role="group">
Expand All @@ -82,28 +82,28 @@
<div role="none"><div role="listitem">item 2</div></div>
</div>

<div role="suggestion" id="fail9">
<div role="suggestion" id="fail7">
<div aria-busy="true"></div>
</div>
<div role="suggestion" id="fail10" aria-busy="false"></div>
<div role="list" id="fail11">
<div role="suggestion" id="fail8" aria-busy="false"></div>
<div role="list" id="fail9">
<li>Item 1</li>
<span role="link">Item 2</span>
</div>
<div role="list" id="fail12">
<div role="list" id="fail10">
<div aria-live="polite">
<div role="listitem">List item 1</div>
<div role="listitem">List item 2</div>
</div>
</div>
<div role="list" id="fail13">
<div role="list" id="fail11">
<div tabindex="0">
<div role="listitem">List item 1</div>
<div role="listitem">List item 2</div>
</div>
</div>

<div role="list" id="fail14">
<div role="list" id="fail12">
<div aria-busy="true"></div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
["#fail9"],
["#fail10"],
["#fail11"],
["#fail12"],
["#fail13"],
["#fail14"]
["#fail12"]
],
"passes": [
["#pass1"],
Expand All @@ -42,6 +40,8 @@
["#incomplete6"],
["#incomplete7"],
["#incomplete8"],
["#incomplete9"]
["#incomplete9"],
["#incomplete10"],
["#incomplete11"]
]
}

0 comments on commit d11aed8

Please sign in to comment.