-
Notifications
You must be signed in to change notification settings - Fork 125
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
Update: change default role for custom elements #2383
base: main
Are you sure you want to change the base?
Conversation
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.
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify site 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 |
pull comments into role table cell combine custom elements and form associated custom elements into a single mapping table
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 wording to be consistent between steps
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 <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Auto-Submit: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1391105}
@@ -226,7 +226,8 @@ <h3>HTML Element Role Mappings</h3> | |||
specified which would require a more specific <a>minimum role</a> to be exposed. | |||
</li> | |||
<li> | |||
Where an element is indicated as having "No corresponding (WAI-ARIA) role", or is mapped to the <a class="core-mapping" href="#role-map-generic">`generic`</a> role, user agents | |||
Where an element is indicated as having "No corresponding (WAI-ARIA) role", or is mapped to the <a class="core-mapping" href="#role-map-generic">`generic`</a> |
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.
I conceded excluding aria-roledescription
on generic
a while back, though I don't fully agree... Adding none
to the list of exclusions is probably okay, too.
However, excluding it on all host language native roles is not okay.
Where an element is indicated as having "No corresponding (WAI-ARIA) role", or is mapped to the <a class="core-mapping" href="#role-map-generic">`generic`</a> | |
Where an element is mapped to the <a class="core-mapping" href="#role-map-generic">`generic`</a> |
<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...
<li>else if the custom element is focusable: map to the <a class="core-mapping" href="#role-map-generic">`group`</a> role</li> | ||
<li>else if an author specifies a global ARIA attribute on the custom element that creates a relation with another element: map to the <a class="core-mapping" href="#role-map-generic">`group`</a> role</li> | ||
<li>else if the custom element has no attached shadow root: map to the <a class="core-mapping" href="#role-map-generic">`generic`</a> role</li> | ||
<li>else if the custom element has an `aria-live` attribute: map to the <a class="core-mapping" href="#role-map-generic">`generic`</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 generic? Could we map to unknown or something and log a warning? Generic-izing this element will have the side effect of making some other features not work unexpectedly.
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.
i'm not sure i follow this or the next comment - since custom elements are presently generic anything that says to map this to generic is essentially keeping the status quo.
<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> | ||
<li>else if an author specifies a global ARIA attribute on the custom element that creates a relation with another element: map to the <a class="core-mapping" href="#role-map-generic">`group`</a> role</li> | ||
<li>else if the custom element has no attached shadow root: map to the <a class="core-mapping" href="#role-map-generic">`generic`</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.
Does the generic
minimum role close this off for updates later? Maybe an author intended to add an aria-label
at some point later, but this mapping now invalidates that later update?
Co-authored-by: James Craig <[email protected]>
Co-authored-by: James Craig <[email protected]>
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.