Skip to content

Add accessibility role mappings to element definitions #3282

Closed

Description

@LJWatson

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.

Activity

  1. brucelawson commented on Dec 12, 2017

    @brucelawson

    Happy to help, too. Anything that helps authors make more accessible sites is groovy.

  2. domenic commented on Dec 12, 2017

    @domenic
    Member

    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.

  3. LJWatson commented on Dec 12, 2017

    @LJWatson
    Author

    I don't think there is a JSON export of the mappings data ATM, but assume one could be created.

  4. LJWatson commented on Dec 12, 2017

    @LJWatson
    Author

    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).

  5. domenic commented on Dec 12, 2017

    @domenic
    Member

    Hmm, I thought this issue was about accessibility role mappings though, not role conformance?

  6. LJWatson commented on Dec 12, 2017

    @LJWatson
    Author

    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.

  7. domenic commented on Dec 12, 2017

    @domenic
    Member

    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?

  8. sideshowbarker commented on Dec 12, 2017

    @sideshowbarker
    Member

    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.

  9. LJWatson commented on Dec 12, 2017

    @LJWatson
    Author

    <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.

  10. domenic commented on Dec 12, 2017

    @domenic
    Member

    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.

  11. annevk commented on Dec 13, 2017

    @annevk
    Member

    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.

  12. added
    accessibility
    on Dec 13, 2017
  13. annevk commented on Dec 13, 2017

    @annevk
    Member

    cc @whatwg/a11y

  14. patrickhlauke commented on Dec 13, 2017

    @patrickhlauke
    Member

    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.

  15. 18 remaining items

  16. domenic commented on Sep 27, 2019

    @domenic
    Member

    Bikeshedding, I would prefer a single dt, maybe "Accessibility considerations", which two dds, e.g. "For authors" and "For implementers".

  17. annevk commented on Sep 27, 2019

    @annevk
    Member

    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.

  18. domenic commented on Sep 27, 2019

    @domenic
    Member

    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?

  19. annevk commented on Sep 27, 2019

    @annevk
    Member

    Inspired by html-aam:

    input (type attribute in the Date state) accessibility for implementers

  20. carmacleod commented on Oct 1, 2019

    @carmacleod
    Contributor

    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:

    image

    - input type="date" (part 1 of 2 theinput element):

    image

    - input type="date" (part 2 of 2 theDate state):

    image


    Style 2: Using the element name and the input type state in the link text

    - the button element:

    image

    - input type="date" option 1... add all of the links to theinput element:

    image

    - 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:

    image

  21. annevk commented on Oct 1, 2019

    @annevk
    Member

    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.

  22. zcorpan commented on Oct 17, 2019

    @zcorpan
    Member

    I think having two separate lines for each type is a bit verbose, but a variant might work:

    input (type attribute in the Date state) for authors; for implementers.

  23. domenic commented on Oct 18, 2019

    @domenic
    Member

    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?

  24. stevefaulkner commented on Oct 18, 2019

    @stevefaulkner
    Contributor

    @domenic

    although it could be made better if the target specs inserted specific anchor IDs for those sections

    this can be done if you indicate what you need

  25. carmacleod commented on Nov 3, 2019

    @carmacleod
    Contributor

    @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.

    image

  26. domenic commented on Nov 5, 2019

    @domenic
    Member

    @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?

  27. carmacleod commented on Nov 6, 2019

    @carmacleod
    Contributor

    Agreed. Please assign this to me. Thanks!

  28. added a commit that references this issue on May 18, 2025
    a1a503a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

accessibilitydev edition

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions