-
Notifications
You must be signed in to change notification settings - Fork 378
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
Interaction between ElementInternals (e.g. default ARIA) and declarative shadow DOM #972
Comments
There are a few solutions to consider here.
|
I agree that this is something we should work on. In terms of a solution, #1 sounds the most straightforward, and the least confusing from a developer point of view. Since a |
This isn't always true. you can |
Accessibility folks probably wouldn't like (1) because ARIA doesn't have a special semantics like that on all other elements. In particular, it's odd to ignore the ARIA role of an element. |
#2 and #3 seem to be the only solution for components that don't use shadow DOM. Today a component can set its default role / ARIA attributes in If #2 is the solution, then would it make sense to align with cross-root ARIA delegation, since the syntax is similar? |
Yes sorry, I meant (4). |
Today in the AOM meeting we discussed (4) – i.e., should the Arguments against A:
Arguments against B:
My personal preference is A, if only to have symmetry with the imperative use case. If there aren't many great use cases for Also, I do have a rough sketch of a shadowless component using Maybe a developer would use this technique if 1) they didn't want to use shadow DOM for various reasons, or 2) their custom element only needs one DOM node anyway. In this case, the component author could have a default <my-button></my-button> < !-- implicit role=button and aria-label="I am a button" --> ... but the consumer could override it. <my-button role="tab" aria-label="I am a tab"></my-button> |
Somewhat related: |
That would be non-conforming, see the content model https://html.spec.whatwg.org/multipage/scripting.html#the-template-element It doesn't mean that it's not possible, but we don't need to take it into account when designing a solution to this issue. |
We need a way of serializing default ARIA role and other ARIA attributes usually specified on
ElementInternals
when using declarative shadow DOM.The text was updated successfully, but these errors were encountered: