-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: support children presentational property on roles #26
Comments
Would Somewhat suggested by #25, I’m thinking that deep traversal would just only be supported if passing in an actual element, in a DOM-like environment (i.e. this would throw an error when only passing in an object element) Just as a larger question, many roles (trees, menus, etc) do require specific hierarchies. Would |
Not sure… something about it feels ambiguous as to whether children have a (implicit or explicit) presentational role, whereas the intent is to understand if this current element has a role such that children should be considered/made/assumed presentational… I think this need only act on Not sure what a better alternative would be…
Though feel a bit clunky? |
Hm yeah originally I just skipped all the “SHOULD”s and stuck with “MUST”s because the lint rules I was writing needed black-and-white errors and not so much loose warnings, if that makes sense. I could see 2 approaches here that might address this and related issues:
I’m leaning toward the latter, so long as we still keep the “MUST” information obvious. And we include the “SHOULD” information in perhaps a more ambiguous way and leave it up to the consumer to have the knowledge to know how to use it (such as yourself). Does that sound reasonable? (Sorry for the side-tangent, just wanted to think about this holistically) |
Proposal
Summary
The WAI-ARIA spec defines for each role whether children of said role are considered presentational.
This request is to extend the current roles interface with this additional Boolean from the spec.
Detail
See https://www.w3.org/TR/wai-aria-1.3/#childrenArePresentational for the explanation.
See https://www.w3.org/TR/wai-aria-1.3/#img as an example of a role with presentational children.
Expect would extend the current
RoleData
interface at https://github.com/drwpow/html-aria/blob/main/src/lib/aria-roles.ts#L15.Example
A commonish example is when writing custom images with aria:
(Taken from WPT test suite, citation needed)
Consumers of this library would benefit from the new property as it would help inform that they should consider the children of the div with the
img
role as presentational, and therefore that they should not be considered by user agents / ATs etc.Tradeoffs / breaking changes
This would introduce additional maintenance overhead.
It would also slightly counter the tenet that only MUST requirements are adhered to for this library - though as a counter, the addition is to reflect the spec, it would be on downstream consumers to decide if they consume and adhere to the property value/purpose.
Alternatives considered
Continue to use
aria-query
or an alternative library for this data.The text was updated successfully, but these errors were encountered: