core-aam icon indicating copy to clipboard operation
core-aam copied to clipboard

Change mapping for generic

Open JAWS-test opened this issue 2 years ago • 5 comments

If many HTML elements map to generic in the future, which are not grouping elements, then the mapping of generic should be adjusted. See: https://github.com/w3c/html-aria/issues/406

JAWS-test avatar Mar 18 '22 12:03 JAWS-test

This is more directly related to https://github.com/w3c/html-aam/issues/373 and https://github.com/w3c/aria/pull/996

scottaohara avatar Mar 18 '22 13:03 scottaohara

need to solve #996 first

jnurthen avatar Mar 24 '22 17:03 jnurthen

as mentioned on the ARIA WG call today, in lieu of completing the work on https://github.com/w3c/aria/pull/996, a stop gap could be to add a note to core aam that indicates that the generic role mappings would be based on either div or span mappings per the element/css rendering of the element.

scottaohara avatar Apr 14 '22 17:04 scottaohara

This morning, @ScottAOHara and I discussed creating a new section in Core-AAM that outlines the use and complications of mapping generic. HTML-AAM and other AAM docs (SVG, MathML) could link across to this section with any relevant caveats.

Mapping to generic assumes the text style properties come with the mapping. For example, <b> and <span style="font-weight: bold;"> would be mapped as generic with identical font styles, but distinct from <i> and <span style="font-style: italic;">... Positioning and various CSS display would also be exposed even on generic elements. AT can already convey a lot of these text-style, display-style, and position/bounds to the user, regardless of the platform role.

This is how the macOS AX API exposes style-based elements separately, and as I understand it, similar behavior is common on other platforms and with other AT. (Please comment if you know of major patterns where my understanding is wholly wrong for a particular API, and not just a caveat like the ones mentioned below.)

Another example of this is that <span> and <div> can be remapped interchangeably as long as the author redefines the default display styles accordingly. In this way, the generic role is not as much about the original tag name as it is about the current rendering of the element.

Of course there will be a lot of exceptions or caveats that will need mentioning in the mapping tables... and some as examples in the new section. For example:

  • bdi/bdo could be ~"generic*, with respective mapping for html:dir"
  • <span> with a click handler (an author error) could still be generic, as long as the "click-ability" is also exposed as defined for the platform. [Update: click-ability should probably be mentioned in the main section, rather than as a caveat, but leaving here because it illustrates how generic as a role can still work with all these leftover elements and examples that have different characteristics.]

I'll try to draft a first pass of that new Core-AAM section, then request comments from various implementors before finishing it and fleshing out the rest.

cookiecrook avatar May 02 '22 17:05 cookiecrook

Okay, this is pretty rough, but I want to get feedback on the approach/direction before spending anymore time getting it into a usable PR. Draft PR coming imminently.

cookiecrook avatar May 06 '22 00:05 cookiecrook