You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add accessibility role mappings to element definitions #3282
The developer's edition of HTML doesn't presently include role mapping information for elements. I think this information is helpful to authors, especially as we get closer to role parity for HTML.
It would be a positive step to add this information to this version of HTML. If there is agreement to do so, I'd be happy to work on it.
Reacted by bruce lawson, Steve Faulkner, Ilya Streltsyn, Shane Hudson, Marco Hengstenberg, Scott O'Hara, sideshowbarker, Masataka Yakura, Tomasz Jakut, Marcy Sutton-Todd and 3 more
I think this would be great, both in the developer's edition and the normal one. The main issue is keeping it up to date, so it's not just a source of confusion that could at times contradict the normative source in the AAM spec. So we should get this to be auto-generated from the AAM spec via the build process.
Probably the first step, then, is to have some JSON file (or similar simple-to-parse format) with the mappings, hosted and maintained by the AAM spec editor(s) and kept always updated in parallel with AAM. Does that exist yet perhaps? I'm on my phone and haven't checked the AAM spec or its repo yet.
Worth noting that role conformance for HTML is defined in ARIA in HTML, rather than the HTML AAM (though the AAM is the source of some data within the ARIA in HTML spec).
The suggestion is to reference the implicit role for each element, but I think there's a case to be made for also referencing the explicit roles that may be applied.
I see. So this would basically be reversing f619b0c then, right? (With much more up-to-date content, of course; I know @stevefaulkner and others have done a much more conscientious job maintaining that content over the last few years than Hixie did when it lived in HTML pre-2015.)
If that's the proposal then I'd really worry about duplicating the same information in two places which could get out of sync. So if folks have come to believe over the last two years that this is best in HTML instead of in a separate document, then perhaps what we need to do is merge those portions of AAM/ARIA in HTML back into the HTML Standard?
So this would basically be reversing f619b0c … perhaps what we need to do is merge those portions of AAM/ARIA in HTML back into the HTML Standard?
I don’t think that would be a good idea. There was a strong rationale for moving it out, and I believe that rationale remains as strong as it always has been. I don’t know what problems merging it back in would fix. Keeping the normative text in the ARIA in HTML spec, there’s nothing that prevents also having (repeating) the per-element-ARIA-roles information at point of use in HTML non-normatively (adding meta-language as needed to HTML to make it clear that it’s just referencing ARIA in HTML).
As mentioned in earlier comments, that just comes with the logistical need to make sure the info in the HTML spec stays in sync with what the ARIA in HTML spec has. But that’s doable.
<So this would basically be reversing f619b0c then, right?<
AIRC the primary reason for that PR was that the ARIA in HTML spec had been pulled out of the W3C HTML spec into its own module.
<So if folks have come to believe over the last two years that this is best in HTML instead of in a separate document, then perhaps what we need to do is merge those portions of AAM/ARIA in HTML back into the HTML Standard?<
The HTML AAM is one of a set of closely related and co-ordinated specs maintained at W3C. Fragmenting that work makes no sense to me.
Providing information in context to help authors does make sense though.
I guess I'm still unclear on what's being proposed. If not duplicating the information from AAM/ARIA in HTML into the HTML Standard, what is the proposal?
If it is about duplicating the information, then although having everything in one document is helpful for web authors in some cases, it's unclear how much that makes sense if another document is where the work is actually being done. In all other cases we prefer to reference other documents instead of copying their contents into the spec.
I'm somewhat surprised at the pushback against including normative accessibility mappings in the HTML Standard. It seems that just like the APIs for elements and their rendering information, you'd want accessibility mappings to be tightly coupled so accessibility gets considered when these elements get implemented or refactored in implementations.
And furthermore, it would also ensure accessibility gets considered when adding new elements or changing existing elements. Much more so than it is today as today it is easily overlooked, which goes somewhat against the idea that you need to consider accessibility from the get go.
It would be good if the WHATWG spec included all the accessibility mappings etc, but asking for the work which quite nicely is proceeding under W3C be moved wholesale here seems a bit of a landgrab. Unless I'm misunderstanding the point.
With @domenic's nit taken into account I think that's great. Maybe "button accessibility for authors" and "button accessibility for implementers" so that the link text is reasonably unique throughout the standard. And also, I suspect we need something like that anyway to cover the more complicated elements, such as input.
Although I'd prefer not to repeat the element name inside the dl personally---we don't do it so far, instead using the heading to govern all the context---you raise a good point about the more complicated scenarios. Could we pick one or two of those and come up with a concrete proposal for the linking text?
Ok, tried to come up with some example screen snaps covering the 2 styles discussed.
Please let me know which style (or combination of styles) is preferred.
Style 1: Without repeating the element name or input type state
- the button element:
- input type="date" (part 1 of 2 theinput element):
- input type="date" (part 2 of 2 theDate state):
Style 2: Using the element name and the input type state in the link text
- the button element:
- input type="date" option 1... add all of the links to theinput element:
- input type="date" option 2... where input would just say something like "Depends on the state of the type attribute", and then each state would have the links:
Reacted by Anne van Kesteren and Darien Maillet Valentine
Wow, thanks for all that work @carmacleod! I think we'll have to wait a bit for @domenic to get back from vacation to make a decision here. I’m personally happy with all of these though prefer putting it all in the green box.
Thanks so much @carmacleod for these explorations, and I'm sorry to have disappeared on vacation just as you were getting into the swing of things.
My conclusion looking at your examples is that we're not going to be able to have a one-size-fits-all rule. In particular, while I think we should list the different variations for each element in the green domintro block most of the time, for <input> it's just too overwhelming.
So my preference would be "style 1", although for other tags with variations (such as a, form, th, etc.) we should do it more like style style 2 option 1.
Similarly, on specific typography, I think your For Authors.\nFor Implementers. is best in the general case, but when there are variations, we'll want something more like @zcorpan states. The precedent based on input's Categories <dt> would be something like Represents a hyperlink: for authors; for implementers.\nOtherwise: for authors; for implementers.
Now, there is an alternative that I'll throw out there, which I'm unsure about, but I should mention. Which is to just have two links per element, going to the "topmost" ARIA/HTML-AAM mapping. So e.g. input would go to input (type attribute in the Button state) in HTML-AAM and input type=button for HTML-ARIA. Then we would expect people to scroll down to see all the variants.
This is a bit semantically unsound, although it could be made better if the target specs inserted specific anchor IDs for those sections. E.g. we could link to #input-mapping or similar and guarantee that, through any refactorings, that would point to something that allows you to scroll through all the different input mappings.
Is this variant worth pursuing, or should we continue refining the version discussed above, which links to all HTML-AAM/HTML-ARIA mapping variants from HTML directly?
@domenic Hope you had an awesome vacation, and sorry to take so long to get back to you! :)
Your "link to #input-mapping" alternative is an excellent compromise for input, but first, please have a look at this screen snap of "@zcorpan's input variant" with all of the types listed in the domintro block.
It may not be as overwhelming as it originally seemed, and it allows for consistency across all elements, including input (and others with variants, using the typography you suggested above).
My thinking is that, if at all possible, I would prefer to list (and link to) the input types separately because many authors may not realize that every input type has unique accessibility considerations.
@carmacleod that looks reasonable to me, although I don't think we need to list the tag name redundantly. So I'd suggest something like
type attribute in the Hidden state: for authors; for implementers.
At this point it might be best to start working on a pull request :). Perhaps it'd be good to start with input (the big one), a (a tiny bit of complications), and then something simple like button?
Activity
brucelawson commentedon Dec 12, 2017
Happy to help, too. Anything that helps authors make more accessible sites is groovy.
domenic commentedon Dec 12, 2017
I think this would be great, both in the developer's edition and the normal one. The main issue is keeping it up to date, so it's not just a source of confusion that could at times contradict the normative source in the AAM spec. So we should get this to be auto-generated from the AAM spec via the build process.
Probably the first step, then, is to have some JSON file (or similar simple-to-parse format) with the mappings, hosted and maintained by the AAM spec editor(s) and kept always updated in parallel with AAM. Does that exist yet perhaps? I'm on my phone and haven't checked the AAM spec or its repo yet.
LJWatson commentedon Dec 12, 2017
I don't think there is a JSON export of the mappings data ATM, but assume one could be created.
LJWatson commentedon Dec 12, 2017
Worth noting that role conformance for HTML is defined in ARIA in HTML, rather than the HTML AAM (though the AAM is the source of some data within the ARIA in HTML spec).
domenic commentedon Dec 12, 2017
Hmm, I thought this issue was about accessibility role mappings though, not role conformance?
LJWatson commentedon Dec 12, 2017
The suggestion is to reference the implicit role for each element, but I think there's a case to be made for also referencing the explicit roles that may be applied.
domenic commentedon Dec 12, 2017
I see. So this would basically be reversing f619b0c then, right? (With much more up-to-date content, of course; I know @stevefaulkner and others have done a much more conscientious job maintaining that content over the last few years than Hixie did when it lived in HTML pre-2015.)
If that's the proposal then I'd really worry about duplicating the same information in two places which could get out of sync. So if folks have come to believe over the last two years that this is best in HTML instead of in a separate document, then perhaps what we need to do is merge those portions of AAM/ARIA in HTML back into the HTML Standard?
sideshowbarker commentedon Dec 12, 2017
I don’t think that would be a good idea. There was a strong rationale for moving it out, and I believe that rationale remains as strong as it always has been. I don’t know what problems merging it back in would fix. Keeping the normative text in the ARIA in HTML spec, there’s nothing that prevents also having (repeating) the per-element-ARIA-roles information at point of use in HTML non-normatively (adding meta-language as needed to HTML to make it clear that it’s just referencing ARIA in HTML).
As mentioned in earlier comments, that just comes with the logistical need to make sure the info in the HTML spec stays in sync with what the ARIA in HTML spec has. But that’s doable.
LJWatson commentedon Dec 12, 2017
<So this would basically be reversing f619b0c then, right?<
AIRC the primary reason for that PR was that the ARIA in HTML spec had been pulled out of the W3C HTML spec into its own module.
<So if folks have come to believe over the last two years that this is best in HTML instead of in a separate document, then perhaps what we need to do is merge those portions of AAM/ARIA in HTML back into the HTML Standard?<
The HTML AAM is one of a set of closely related and co-ordinated specs maintained at W3C. Fragmenting that work makes no sense to me.
Providing information in context to help authors does make sense though.
domenic commentedon Dec 12, 2017
I guess I'm still unclear on what's being proposed. If not duplicating the information from AAM/ARIA in HTML into the HTML Standard, what is the proposal?
If it is about duplicating the information, then although having everything in one document is helpful for web authors in some cases, it's unclear how much that makes sense if another document is where the work is actually being done. In all other cases we prefer to reference other documents instead of copying their contents into the spec.
annevk commentedon Dec 13, 2017
I'm somewhat surprised at the pushback against including normative accessibility mappings in the HTML Standard. It seems that just like the APIs for elements and their rendering information, you'd want accessibility mappings to be tightly coupled so accessibility gets considered when these elements get implemented or refactored in implementations.
And furthermore, it would also ensure accessibility gets considered when adding new elements or changing existing elements. Much more so than it is today as today it is easily overlooked, which goes somewhat against the idea that you need to consider accessibility from the get go.
annevk commentedon Dec 13, 2017
cc @whatwg/a11y
patrickhlauke commentedon Dec 13, 2017
there's too much politics tied to this, but let me see: am i right in understanding that there's a question here of why there's a pushback to moving AAM/ARIA in HTML over to the WHATWG spec directly? If so, I may just quote something @jakearchibald said to me on twitter yesterday: "why should the work move to a fork?" (https://twitter.com/jaffathecake/status/940513109118251008)
It would be good if the WHATWG spec included all the accessibility mappings etc, but asking for the work which quite nicely is proceeding under W3C be moved wholesale here seems a bit of a landgrab. Unless I'm misunderstanding the point.
18 remaining items
domenic commentedon Sep 27, 2019
Bikeshedding, I would prefer a single dt, maybe "Accessibility considerations", which two dds, e.g. "For authors" and "For implementers".
annevk commentedon Sep 27, 2019
With @domenic's nit taken into account I think that's great. Maybe "
buttonaccessibility for authors" and "buttonaccessibility for implementers" so that the link text is reasonably unique throughout the standard. And also, I suspect we need something like that anyway to cover the more complicated elements, such asinput.domenic commentedon Sep 27, 2019
Although I'd prefer not to repeat the element name inside the dl personally---we don't do it so far, instead using the heading to govern all the context---you raise a good point about the more complicated scenarios. Could we pick one or two of those and come up with a concrete proposal for the linking text?
annevk commentedon Sep 27, 2019
Inspired by html-aam:
carmacleod commentedon Oct 1, 2019
Ok, tried to come up with some example screen snaps covering the 2 styles discussed.
Please let me know which style (or combination of styles) is preferred.
Style 1: Without repeating the element name or input type state
- the
buttonelement:-
input type="date"(part 1 of 2 theinputelement):-
input type="date"(part 2 of 2 theDatestate):Style 2: Using the element name and the input type state in the link text
- the
buttonelement:-
input type="date"option 1... add all of the links to theinputelement:-
input type="date"option 2... whereinputwould just say something like "Depends on the state of thetypeattribute", and then each state would have the links:annevk commentedon Oct 1, 2019
Wow, thanks for all that work @carmacleod! I think we'll have to wait a bit for @domenic to get back from vacation to make a decision here. I’m personally happy with all of these though prefer putting it all in the green box.
zcorpan commentedon Oct 17, 2019
I think having two separate lines for each
typeis a bit verbose, but a variant might work:domenic commentedon Oct 18, 2019
Thanks so much @carmacleod for these explorations, and I'm sorry to have disappeared on vacation just as you were getting into the swing of things.
My conclusion looking at your examples is that we're not going to be able to have a one-size-fits-all rule. In particular, while I think we should list the different variations for each element in the green domintro block most of the time, for
<input>it's just too overwhelming.So my preference would be "style 1", although for other tags with variations (such as
a,form,th, etc.) we should do it more like style style 2 option 1.Similarly, on specific typography, I think your
For Authors.\nFor Implementers.is best in the general case, but when there are variations, we'll want something more like @zcorpan states. The precedent based oninput's Categories<dt>would be something likeRepresents a hyperlink: for authors; for implementers.\nOtherwise: for authors; for implementers.Now, there is an alternative that I'll throw out there, which I'm unsure about, but I should mention. Which is to just have two links per element, going to the "topmost" ARIA/HTML-AAM mapping. So e.g.
inputwould go toinput (type attribute in the Button state)in HTML-AAM andinput type=buttonfor HTML-ARIA. Then we would expect people to scroll down to see all the variants.This is a bit semantically unsound, although it could be made better if the target specs inserted specific anchor IDs for those sections. E.g. we could link to
#input-mappingor similar and guarantee that, through any refactorings, that would point to something that allows you to scroll through all the different input mappings.Is this variant worth pursuing, or should we continue refining the version discussed above, which links to all HTML-AAM/HTML-ARIA mapping variants from HTML directly?
stevefaulkner commentedon Oct 18, 2019
@domenic
this can be done if you indicate what you need
carmacleod commentedon Nov 3, 2019
@domenic Hope you had an awesome vacation, and sorry to take so long to get back to you! :)
Your "link to #input-mapping" alternative is an excellent compromise for input, but first, please have a look at this screen snap of "@zcorpan's input variant" with all of the types listed in the domintro block.
It may not be as overwhelming as it originally seemed, and it allows for consistency across all elements, including input (and others with variants, using the typography you suggested above).
My thinking is that, if at all possible, I would prefer to list (and link to) the input types separately because many authors may not realize that every input type has unique accessibility considerations.
domenic commentedon Nov 5, 2019
@carmacleod that looks reasonable to me, although I don't think we need to list the tag name redundantly. So I'd suggest something like
At this point it might be best to start working on a pull request :). Perhaps it'd be good to start with
input(the big one),a(a tiny bit of complications), and then something simple likebutton?carmacleod commentedon Nov 6, 2019
Agreed. Please assign this to me. Thanks!
Add Accessibility considerations to element definitions