-
Notifications
You must be signed in to change notification settings - Fork 137
Update: change default role for custom elements #2383
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
marking as draft as the form associated custom element mapping table also needs updating - but i want to make sure i got this going in the right direction before i edit that table too |
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.
Awesome, after many iterations
Update custom role rules and tests based on new text at w3c/aria#2383 Behind feature flag: --enable-blink-features=AccessibilityCustomElementRoleNone Intent to prototype / chromestatus entry: https://chromestatus.com/feature/5079996916563968?gate=5150348547981312 Bug: w3c/aria#2303 Bug: WICG/webcomponents#1073 Bug: 379674023 Change-Id: If317916b432bc5a627c8ea6fa0654e6c98a10ea6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6042465 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391105}
html-aam/index.html
Outdated
| <ul> | ||
| <li>If the author assigned a conforming ARIA role using the `role` attribute, or by the custom element's internals: map to the specified role.</li> | ||
| <li>else if the author assigned HTML attributes that result in a <a>minimum role</a>: map to the minimum role.</li> | ||
| <li>else if the custom element is focusable: map to the <a class="core-mapping" href="#role-map-generic">`group`</a> role</li> |
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.
Why group? Could we map to unknown or something and log a warning?
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.
also this links to generic, not group
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.
that typo maight be easier to avoid using the respective <rref> tag...
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.
fixed the incorrect link. i never thought to use rref in html aam - wasn't sure that'd work. i don't see that used in core aam either.
maybe it'd work now with the specs all in one repo?
re: about mapping to group or something else - i'm open to ideas. cc @aleventhal if you have thoughts?
|
@cookiecrook can you respond to @scottaohara comments to help move this forward? |
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.
Sorry for the ridiculously slow turnaround here. Just a couple of questions, but overall this looks good to me.
This updates a custom element's default role to none to allow attribute reflection from the custom element parent to its internals.
Just to be extra clear, when you say "allow attribute reflection" here, you mean that the component could copy attributes itself (e.g. aria-label), not that these would be implicitly reflected somehow? Nothing in the proposed spec text suggests implicit reflectoin; I just wanted to double check my understanding.
| <ul> | ||
| <li>If the author assigned a conforming role using the `role` attribute, or by the custom element's internals: map to the specified role.</li> | ||
| <li>else if the author assigned HTML attributes that result in a <a>minimum role</a>: map to the minimum role.</li> | ||
| <li>else if the custom element is focusable: map to the <a class="core-mapping" href="#role-map-group">`group`</a> role</li> |
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.
Should this be done even if a custom element's ShadowRoot has delegatesFocus: true? It's a tricky one. On one hand, it's a pretty important principle to expose focusable elements to accessibility. On the other hand, when delegatesFocus is true, the element isn't in the tab order; it is effectively transparent as far as focus is concerned.
I think it's probably safer to still use role="group" even for delegatesFocus: true. For example, browser native date/time inputs expose the container and allow it to be focused, even though it isn't part of the tab order. Nevertheless, I thought I'd clarify because I haven't seen any discussion of delegatesFocus either here or in #2303.
closes #2303 This updates a custom element's default role to none to allow attribute reflection from the custom element parent to its internals. This change provides additional clarification about how a custom element can be provided a role by authors, and what caveats would change a custom element's default role of none, to another implicit minimum role.
pull comments into role table cell combine custom elements and form associated custom elements into a single mapping table
update wording to be consistent between steps
Co-authored-by: James Craig <cookiecrook@users.noreply.github.com>
Co-authored-by: James Craig <cookiecrook@users.noreply.github.com>
Co-authored-by: James Craig <cookiecrook@users.noreply.github.com>
13b52fc to
a4d84a8
Compare
closes #2303
This updates a custom element's default role to none to allow attribute reflection from the custom element parent to its internals.
This change provides additional clarification about how a custom element can be provided a role by authors, and what caveats would change a custom element's default role of none, to another implicit minimum role.
Test, Documentation and Implementation tracking
Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.