Skip to content

Commit a4fa44d

Browse files
committed
fix(aria--allowed-role): Allow iframe role=none
1 parent c60a7d1 commit a4fa44d

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

lib/commons/aria/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ lookupTable.role = {
522522
context: null,
523523
implicit: ['body'],
524524
unsupported: false,
525-
allowedElements: ['article', 'embed', 'iframe', 'section', 'svg', 'object']
525+
allowedElements: ['article', 'embed', 'iframe', 'object', 'section', 'svg']
526526
},
527527
'doc-abstract': {
528528
type: 'section',
@@ -1407,9 +1407,11 @@ lookupTable.role = {
14071407
'h5',
14081408
'h6',
14091409
'header',
1410+
'iframe',
14101411
'li',
1412+
'ol',
14111413
'section',
1412-
'ol'
1414+
'ul'
14131415
]
14141416
},
14151417
{
@@ -1491,9 +1493,11 @@ lookupTable.role = {
14911493
'h5',
14921494
'h6',
14931495
'header',
1496+
'iframe',
14941497
'li',
1498+
'ol',
14951499
'section',
1496-
'ol'
1500+
'ul'
14971501
]
14981502
},
14991503
{

test/integration/rules/aria-allowed-role/aria-allowed-role.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ <h1 id='pass-h1-valid-role' role='none'></h1>
4141
<aside id="pass-aside-role-region" role="region"></aside>
4242
<form action="" id='pass-form-role-search' role="search"></form>
4343
<ul><li id="pass-li-role-sep" role="separator"></li></ul>
44+
<iframe src="dummy.html" role="presentation" id="pass-iframe-presentation"></iframe>
45+
<iframe src="dummy.html" role="none" id="pass-iframe-none"></iframe>
4446
<my-custom-element id="pass-custom-element-any-role" role='navigation'></my-custom-element>
4547
<dd id='fail-dd-no-role' role='link'></dd>
4648
<dt id='fail-dt-no-role' role='banner'></dt>

test/integration/rules/aria-allowed-role/aria-allowed-role.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
["#pass-aside-role-region"],
4646
["#pass-form-role-search"],
4747
["#pass-li-role-sep"],
48+
["#pass-iframe-presentation"],
49+
["#pass-iframe-none"],
4850
["#pass-custom-element-any-role"]
4951
],
5052
"violations": [

test/integration/rules/aria-allowed-role/dummy.html

Whitespace-only changes.

0 commit comments

Comments
 (0)