-
Notifications
You must be signed in to change notification settings - Fork 789
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 all 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 (types): https://www.w3.org/TR/wai-aria/#abstract_roles | ||||||
|
||||||
/* 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,13 +18,13 @@ | |||||
*/ | ||||||
const ariaRoles = { | ||||||
alert: { | ||||||
type: 'widget', | ||||||
type: 'structure', | ||||||
// 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'], | ||||||
|
@@ -119,6 +120,7 @@ const ariaRoles = { | |||||
nameFromContent: true | ||||||
}, | ||||||
combobox: { | ||||||
// Note: spec difference | ||||||
type: 'widget', | ||||||
requiredAttrs: ['aria-expanded', 'aria-controls'], | ||||||
allowedAttrs: [ | ||||||
|
@@ -169,7 +171,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,6 +303,7 @@ const ariaRoles = { | |||||
superclassRole: ['section'] | ||||||
}, | ||||||
listbox: { | ||||||
// Note: spec difference | ||||||
type: 'widget', | ||||||
requiredOwned: ['group', 'option'], | ||||||
allowedAttrs: [ | ||||||
|
@@ -328,7 +331,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 +343,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 +699,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 +819,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.
This creates a problem for
focus-order-semantics
. With this change, the following is going to start failing. I don't think we should want that.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
focus-order-semantics
rule. I think the best way to do that is just to add them to theVALID_ROLES_FOR_SCROLLABLE_REGIONS
object invalid-scrollable-semantics-evaluate
.