Replies: 1 comment 1 reply
-
I've only experimented with "polyfilling" cross-root ARIA, but I had assumed that putting CSS In general, though, isn't this a problem with ARIA/AOM more generally and not specific to shadow roots? You could have the same problem if you wanted to (for whatever reason) wrap your
Besides seeing browser vendors commit to a specific spec (either Ben's or Alice's, or ideally both since they're somewhat orthogonal), I'd also like to see the browser vendors make progress on ARIAMixin, in particular:
To me, ARIAMixin is kind of "table stakes" for cross-root ARIA. It solves at least some problems with ARIA references crossing shadow boundaries (for references pointing to shadow-including ancestors, at least), and it could be used as a foundation to build a decent polyfill for cross-root ARIA. |
Beta Was this translation helpful? Give feedback.
-
This problem space is expertly described by Alice Boxhall in this blog post.
There are a number of open proposals in this area as of today:
Borrowing from Ben Howell's Element Handle RFC, the complexity of the problem that we're trying to solve looks a bit like this:
How do you associate all of the elements within the above example accessibly in the presence of shadow DOM boundaries?
The majority of the proposals above are restricted by the "bottleneck effect":
When there are multiple associations of a type outside or inside of the shadow boundary to be made, completing the accessibility contract defeats many of the most clever proposals. Currently, the Element Handles proposal seems to be the only proposal with an active supporter that overcomes this situation. I can't speak for Ben specifically borrowing from the Import/Export IDs proposal or not, but it would be disrespectful not to point out some of the similarities in the proposals, and the ability of Import/Export IDs to also address the bottleneck effect. However, it is currently unclear to active participants in the conversation why/how it was originally dropped as a proposal and without an active owner of the proposal is not currently being reviewed as a viable alternative.
With the capabilities unlocked by the Element Handles API, the above DOM would become fully accessible via the following edits:
There are active questions about the naming and verbosity of this proposal that could be actively addressed by broader web developer participation in the discussion. This could also be visited more productively in light of a prototype, either behind a flag or via a polyfill of sorts. The pursuit of this path was a takeaway from a recent AOM Working Group meeting.
Sometimes the bottleneck is the right thing...
While the bottleneck effect can negatively effect complex contexts like the above example, it may be that a proposal that is specifically bound by this reality would be beneficial in parallel with something like the above. Take the following example:
In this example, the
<x-button>
element is wrapping a native<button>
element for lack of a more clear path by which to achieve the native functionality of this element (see Customized Built-ins and Alternatives for more information here). These "button" elements are gathered in a<div>
that holds theradiogroup
role. To appropriately fulfill the accessibility contract of the role, the "radio items" within this group need to be direct children of the container. How is this relationship to be achieved while still encapsulating custom functionality, styling, and DOM content in the child elements?To date, web developers would need to hoist all of the functionality of the
<button>
element into the<x-button>
themselves; pointer, keyboard, focus, etc. etc. all manually.Would an API like Semantic Delegates allow for not only the accessibility data applied to the
<x-button>
to be passed to the<button>
in its shadow root, but ALSO allow for the child association that therole="radiogroup"
element is attempting to make with its direct child (the<x-button>
element) be completed? In this way the<x-button>
would effectively be the<button>
without the disconnect from the parent context that occurs when the shadow boundary is applied.Then we could complete the accessibility contract in the above example via the following code (wavey hands for actual final APIs):
Next steps
The various proposals sit awaiting critical mass. Various approaches have gained excitement from individual implementors that may be leading to in-browser prototypes. However, the biggest signal that would benefit the process at this point to excitement gathering in the web developer community around specific proposals.
Let's answer the questions:
Beta Was this translation helpful? Give feedback.
All reactions