New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(aria-roles): correct abstract roles (types) for aria-roles #4421
Changes from 3 commits
69f778b
ffe37f6
aa1aa20
fd59e8d
2d185f6
417e6b1
facd65f
bfa95ae
a07c488
f11c03f
d856316
dc966d3
9b15ae0
5594d8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||||
// Source: https://www.w3.org/TR/wai-aria-1.1/#roles | ||||||
// Source for abstract roles: https://www.w3.org/TR/wai-aria/#abstract_roles and https://www.w3.org/WAI/ARIA/1.2/class-diagram/rdf_model.svg | ||||||
gaiety-deque marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
/* easiest way to see allowed roles is to filter out the global ones | ||||||
from the list of inherited states and properties. The dpub spec | ||||||
|
@@ -17,21 +18,21 @@ | |||||
*/ | ||||||
const ariaRoles = { | ||||||
alert: { | ||||||
type: 'widget', | ||||||
type: 'structure', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This creates a problem for <div role="alert" tabindex="0"> Hello world </div> This is what we talked about on Thursday. We'll need some way to exempt these roles that are no longer considered as widgets in the |
||||||
// Spec difference: Aria-expanded removed in 1.2 | ||||||
allowedAttrs: ['aria-expanded'], | ||||||
superclassRole: ['section'] | ||||||
}, | ||||||
alertdialog: { | ||||||
type: 'widget', | ||||||
type: 'window', | ||||||
straker marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
// Spec difference: Aria-expanded removed in 1.2 | ||||||
allowedAttrs: ['aria-expanded', 'aria-modal'], | ||||||
superclassRole: ['alert', 'dialog'], | ||||||
accessibleNameRequired: true | ||||||
}, | ||||||
application: { | ||||||
// Note: spec difference | ||||||
type: 'landmark', | ||||||
type: 'structure', | ||||||
gaiety-deque marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
// Note: aria-expanded is not in the 1.1 spec but is | ||||||
// consistently supported in ATs and was added in 1.2 | ||||||
allowedAttrs: ['aria-activedescendant', 'aria-expanded'], | ||||||
|
@@ -119,7 +120,7 @@ const ariaRoles = { | |||||
nameFromContent: true | ||||||
}, | ||||||
combobox: { | ||||||
type: 'widget', | ||||||
type: 'composite', | ||||||
gaiety-deque marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
requiredAttrs: ['aria-expanded', 'aria-controls'], | ||||||
allowedAttrs: [ | ||||||
'aria-owns', | ||||||
|
@@ -169,7 +170,7 @@ const ariaRoles = { | |||||
prohibitedAttrs: ['aria-label', 'aria-labelledby'] | ||||||
}, | ||||||
dialog: { | ||||||
type: 'widget', | ||||||
type: 'window', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we said There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with Ava. Since this is |
||||||
// Spec difference: Aria-expanded removed in 1.2 | ||||||
allowedAttrs: ['aria-expanded', 'aria-modal'], | ||||||
superclassRole: ['window'], | ||||||
|
@@ -301,7 +302,7 @@ const ariaRoles = { | |||||
superclassRole: ['section'] | ||||||
}, | ||||||
listbox: { | ||||||
type: 'widget', | ||||||
type: 'composite', | ||||||
gaiety-deque marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
requiredOwned: ['group', 'option'], | ||||||
allowedAttrs: [ | ||||||
'aria-multiselectable', | ||||||
|
@@ -328,7 +329,7 @@ const ariaRoles = { | |||||
nameFromContent: true | ||||||
}, | ||||||
log: { | ||||||
type: 'widget', | ||||||
type: 'structure', | ||||||
// Spec difference: Aria-expanded removed in 1.2 | ||||||
allowedAttrs: ['aria-expanded'], | ||||||
superclassRole: ['section'] | ||||||
|
@@ -340,7 +341,7 @@ const ariaRoles = { | |||||
superclassRole: ['landmark'] | ||||||
}, | ||||||
marquee: { | ||||||
type: 'widget', | ||||||
type: 'structure', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you're adding roles to |
||||||
// Spec difference: Aria-expanded removed in 1.2 | ||||||
allowedAttrs: ['aria-expanded'], | ||||||
superclassRole: ['section'] | ||||||
|
@@ -696,7 +697,7 @@ const ariaRoles = { | |||||
accessibleNameRequired: true | ||||||
}, | ||||||
status: { | ||||||
type: 'widget', | ||||||
type: 'structure', | ||||||
// Spec difference: Aria-expanded removed in 1.2 | ||||||
allowedAttrs: ['aria-expanded'], | ||||||
superclassRole: ['section'] | ||||||
|
@@ -816,7 +817,7 @@ const ariaRoles = { | |||||
superclassRole: ['section'] | ||||||
}, | ||||||
timer: { | ||||||
type: 'widget', | ||||||
type: 'structure', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you're adding roles to |
||||||
// Spec difference: Aria-expanded removed in 1.2 | ||||||
allowedAttrs: ['aria-expanded'], | ||||||
superclassRole: ['status'] | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo this change since we'll leave
listbox
andcombobox
as widgetsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undid this change 2d185f6