-
Notifications
You must be signed in to change notification settings - Fork 235
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
[A11y] required-context-role #626
Comments
@MelSumner - Can you include example template snippets that would be good/bad (doesn't need to be exhaustive, but I'd like to make sure we are on the same page). |
@rwjblue any common/easy way to check parents without stack in |
@MelSumner, is this case valid?
when we have few nodes between roles |
@lifeart no, that's not valid. |
@MelSumner can you provide error message for this rule? |
I can take it |
Sure, I'll update the issue to include a suggested error message. |
Done |
@MelSumner, the mdn docs suggest it's okay to include a presentation element between the parent (eg 'menu') and child roles (eg 'menuitem"): https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menuitem_role Are those docs incorrect or does this rule need to be updated? |
Rule Requested
The required context role defines the owning container where this role is allowed. If a role has a required context, authors MUST ensure that an element with the role is contained inside (or owned by) an element with the required context role. For example, an element with
role="listitem"
is only meaningful when contained inside (or owned by) an element withrole="list"
.Roles to check
Format: role | required context role
Example(s)
Conformant Code:
Non-conformant code:
Suggested Error Message
(Replace items in brackets with the item that violated the rule)
"You have an element with the role of {{role}} but it is missing the required (immediate) parent element of {{parent-element-options}}. Reference: https://www.w3.org/TR/wai-aria-1.0/roles#{{role}}."
Reference(s)
The text was updated successfully, but these errors were encountered: