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

Define how custom elements are exposed to AT #152

Open
annevk opened this issue Oct 27, 2022 · 11 comments
Open

Define how custom elements are exposed to AT #152

annevk opened this issue Oct 27, 2022 · 11 comments

Comments

@annevk
Copy link
Member

annevk commented Oct 27, 2022

w3c/accname#170 is a good first step by @nolanlawson regarding the ARIAMixin mixin, but ElementInternals also includes ARIAMixin and as such we need to define how that ends up mapping to AT as well.

https://html.spec.whatwg.org/#accessibility-semantics

Note that this is not straightforward as these are essentially "native semantics" that can then be overridden by actual content attributes on the custom element.

There's also still some problems to be sorted here on the HTML side (probably by @mrego and I with help from @domenic), but I thought I'd start the conversation about this now as this feature has been in HTML for a while.

@jnurthen
Copy link
Member

Discussed in AOM meeting and decided this was probably more appropriate to be filed on core-aam

@domenic
Copy link

domenic commented Feb 22, 2023

https://html.spec.whatwg.org/#wai-aria is intended to answer this question. I'm not sure there's more to do here, but maybe I'm misunderstanding.

@annevk
Copy link
Member Author

annevk commented Feb 22, 2023

@domenic how does that work for element-reflecting attributes?

@domenic
Copy link

domenic commented Feb 22, 2023

Ah, yeah, it doesn't particularly. I believe both base ARIA and that part of HTML are vague about how element-to-element relations are exposed to AT.

@annevk
Copy link
Member Author

annevk commented Feb 22, 2023

WAI-ARIA doesn't really define user agent requirements as far as I can tell. Just requirements on developers. There is an issue for that too as it doesn't acknowledge the empty string: w3c/aria#1842.

I believe the idea is that core-cam would define the user agent requirements.

@domenic looking at that section and the general idea that the content attribute holds the semantics, shouldn't attr-associated element(s) use the reflected content attribute name for attr instead of the reflected IDL attribute's identifier? I think that would make some things easier. E.g., we could check if such a field exists and then return that instead, for instance, without having to map from IDL attribute to content attribute again.

annevk added a commit to whatwg/html that referenced this issue Feb 22, 2023
Other changes:

* Remove reflection of unrestricted double as it is buggy and unused.
* The DOMString getter steps did not account for a missing attribute.
* The native accessibility semantics map was renamed to the internal content attribute map as it's now a more general reflection concept.

Corresponding ARIA PR: w3c/aria#1876.

Fixes #8442.

Follow-up:

* w3c/core-aam#152
* w3c/aria#1110
* #3238
* #8544
* #8545
* #8926
* #8927
* #8928
* #8930
@domenic
Copy link

domenic commented Feb 27, 2023

looking at that section and the general idea that the content attribute holds the semantics, shouldn't attr-associated element(s) use the reflected content attribute name for attr instead of the reflected IDL attribute's identifier?

I don't understand what this is asking. The attr-associated element(s) definitions do use the reflected content attribute name, via how they call "get the content attribute". They don't use the reflected IDL attribute's identifier anywhere, as far as I can tell.

without having to map from IDL attribute to content attribute again.

I don't see where this is done, either in the definition of attr-associated element(s) or elsewhere.

@annevk
Copy link
Member Author

annevk commented Feb 27, 2023

@domenic what's the value of attr in attr-associated element(s) in your mind? I thought it was the IDL attribute identifier. I think it should be the reflected content attribute name.

@domenic
Copy link

domenic commented Feb 27, 2023

Ah, yeah, I understand now. It could go either way depending on what's convenient, I guess. I could see how maybe the content attribute name would be convenient, but it's not obvious without a written-out algorithm for the attr-association processing model.

@annevk
Copy link
Member Author

annevk commented Mar 2, 2023

Well, if we start with https://html.spec.whatwg.org/#wai-aria, how would we modify that?

  1. We would need to get from the custom element to ElementInternals. We could change attached internals to hold null or an ElementInternals object. Solved.
  2. Then, if that is non-null we'd want to check that the ElementInternals object holds an attr-associated element(s) where attr is the IDL attribute identifier corresponding to the attribute name stateOrProperty, right?
    1. I'm not sure how we feel about checking whether an internal slot exists. If we don't like that we'd first have to check if stateOrProperty is element(s) backed I suppose, but I don't see any downside with an existence check so I hope we can go for that.
    2. If instead of finding the IDL attribute identifier we could use stateOrProperty directly that would be much nicer. Other places that use this infrastructure don't care much I think as they are one-offs and don't really need generic infrastructure.

Then ARIA gets one of these values for a given stateOrProperty:

  • A string.
  • An element.
  • An element list.
  • The default value for stateOrProperty.

Does that help?

@domenic
Copy link

domenic commented Mar 2, 2023

I don't see any downside with an existence check so I hope we can go for that.

Yes, seems fine.

If instead of finding the IDL attribute identifier we could use stateOrProperty directly that would be much nicer.

Cool, yeah, I see it now.

annevk added a commit to whatwg/html that referenced this issue Mar 2, 2023
annevk added a commit to whatwg/html that referenced this issue Mar 7, 2023
@annevk
Copy link
Member Author

annevk commented Mar 7, 2023

I consider the HTML side to be ready now. @spectranaut let me know if you or the other editors have questions about this.

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

No branches or pull requests

6 participants