Skip to content

Commit

Permalink
fix(aria-roles): Add WAI-ARIA 1.2 roles
Browse files Browse the repository at this point in the history
Adds new roles from WAI-ARIA 1.2 spec

Closes issue dequelabs#2107
  • Loading branch information
timmybytes committed Oct 7, 2020
1 parent 828864b commit f84abde
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions lib/standards/aria-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ const ariaRoles = {
type: 'landmark',
allowedAttrs: ['aria-expanded']
},
blockquote: {
type: 'structure'
},
button: {
type: 'widget',
allowedAttrs: ['aria-expanded', 'aria-pressed'],
nameFromContent: true
},
caption: {
type: 'structure',
requiredContext: ['figure', 'table', 'grid']
},
cell: {
type: 'structure',
requiredContext: ['row'],
Expand All @@ -67,6 +74,9 @@ const ariaRoles = {
allowedAttrs: ['aria-checked', 'aria-readonly', 'aria-required'],
nameFromContent: true
},
code: {
type: 'structure'
},
columnheader: {
type: 'structure',
requiredContext: ['row'],
Expand Down Expand Up @@ -117,6 +127,9 @@ const ariaRoles = {
type: 'structure',
allowedAttrs: ['aria-expanded']
},
deletion: {
type: 'structure'
},
dialog: {
type: 'widget',
allowedAttrs: ['aria-expanded', 'aria-modal']
Expand All @@ -131,6 +144,9 @@ const ariaRoles = {
type: 'structure',
allowedAttrs: ['aria-expanded']
},
emphasis: {
type: 'structure'
},
feed: {
type: 'structure',
requiredOwned: ['article'],
Expand Down Expand Up @@ -191,6 +207,9 @@ const ariaRoles = {
input: {
type: 'abstract'
},
insertion: {
type: 'structure'
},
landmark: {
type: 'abstract'
},
Expand Down Expand Up @@ -284,6 +303,10 @@ const ariaRoles = {
],
nameFromContent: true
},
meter: {
type: 'structure',
requiredAttrs: ['aria-valuemax', 'aria-valuemin', 'aria-valuenow']
},
navigation: {
type: 'landmark',
allowedAttrs: ['aria-expanded']
Expand All @@ -309,6 +332,9 @@ const ariaRoles = {
],
nameFromContent: true
},
paragraph: {
type: 'structure'
},
presentation: {
type: 'structure'
},
Expand Down Expand Up @@ -488,9 +514,18 @@ const ariaRoles = {
type: 'widget',
allowedAttrs: ['aria-expanded']
},
strong: {
type: 'structure'
},
structure: {
type: 'abstract'
},
subscript: {
type: 'structure'
},
superscript: {
type: 'structure'
},
switch: {
type: 'widget',
requiredAttrs: ['aria-checked'],
Expand Down Expand Up @@ -552,6 +587,9 @@ const ariaRoles = {
'aria-required'
]
},
time: {
type: 'structure'
},
timer: {
type: 'widget',
allowedAttrs: ['aria-expanded']
Expand Down

0 comments on commit f84abde

Please sign in to comment.