Skip to content
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

Generic proposal (Potentially expand beyond aria?) #13

Open
Garbee opened this issue May 16, 2022 · 5 comments
Open

Generic proposal (Potentially expand beyond aria?) #13

Garbee opened this issue May 16, 2022 · 5 comments

Comments

@Garbee
Copy link

Garbee commented May 16, 2022

There are more things than just aria attributes that could benefit from delegation. While it is the most important matter to get working, the same method could be used to help with other situations where references need to be given between shadow boundaries.

One use-case in mind is, datalist for an input. If a developer wants to build an input component that is encapsulated but still allow a list of options to pick from, the datalist if provided in a slot needs to be cloned into the shadow boundary to get referenced. Duplicating the list in memory and just being complex since it'll need to also get watched for changes. With delegation support the list can exist external to the shadow boundary (or just as a child of the component) and the ID reference could work as normal.

Example structure:

    this.attachShadow({ mode: "open", delegatesList: true, });
<x-input list="ice-cream-flavors">
  <!-- Shadow Root -->
  <label for="ice-cream-choice">Choose a flavor:</label>
  <input autolist id="ice-cream-choice" name="ice-cream-choice" />
</x-input>

<datalist id="ice-cream-flavors">
    <option value="Chocolate">
    <option value="Coconut">
    <option value="Mint">
    <option value="Strawberry">
    <option value="Vanilla">
</datalist>
@Westbrook
Copy link
Contributor

Agree on this one! I think there's actually a good number of aria-centric concepts that are not on the AriaMixin particularly in that no ID referenced content is included in that mixin. @leobalter is the use of the AriaMixin as the basis for this version of the spec something that came from browser implementors or something that we could have some flexibility with if addressed early?

A quickly devised list might wonder by aria-labelledby, aria-controls, aria-activedecendent, possibly even role in some cases, amongst others wouldn't be included. Don't mind how those attributes start to constructs a Combobox...nothing to see here 😉

@nolanlawson
Copy link
Collaborator

A really interesting case was brought up recently about elementtiming. It seems like cross-root ARIA delegation could potentially solve this problem as well: w3c/element-timing#3

@mrego
Copy link
Collaborator

mrego commented Oct 24, 2022

More examples about this are included in the new explainer.

@mrego mrego changed the title Potentially expand beyond aria? Generic proposal (Potentially expand beyond aria?) Oct 25, 2022
@nolanlawson
Copy link
Collaborator

Looking through the list in the explainer, it seems pretty straightforward to expand to include IDref attributes like for, list, and popovertoggletarget (né popuptoggletarget).

SVG <use> seems a bit trickier since it's technically not an IDref attribute: <use href='#foo'>.

As for @font-face, this looks like a straight-up browser bug, at least for referencing within the same shadow tree. It works in WebKit, but not in Chromium or in Firefox. That said, even if those bugs were fixed, maybe there is a use case for this? But like SVG <use>, it's not an IDref, so it may need a different API shape.

@nolanlawson
Copy link
Collaborator

nolanlawson commented May 11, 2023

Conclusion from today's cross-root ARIA F2F: we may be interested in this long-term, but we don't want to over-extend ourselves such that the spec grows too broadly in scope.

Something like for may be the most promising in the medium term, but shouldn't be considered a blocker for this spec.

We could also consider how FACE could interact with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants