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

CORE-AAM: Add conditional platform mappings for nameless forms

Open jnurthen opened this issue 7 years ago • 7 comments

From @matatk on January 24, 2017 19:7

This is a spin-off from #513 which resolves that region landmarks should only be considered as such if they are named (via aria-labelledby or aria-label).

Background: I have been researching how screen-readers expose landmarks to users, because I work on a WebExtension that does the same. This issue has been filed as a spin-off from issues filed in other W3C specs (linked below).

This issue proposes that the same approach be applied to form regions, for the reasons mentioned in that thread, and in the related HTML-AAM issue #82 but repeated here for convenience:

  1. There are instances in the wild of <form> elements wrapping whole pages [1,2,3] - these are not really valid landmarks, so considering them as such would add noise and confusion.
  2. When a <form> is 'genuine': if it lacks a label, there's not really any useful landmark information there (it's easy enough to navigate to the form/first form control for most users anyway), so adding all unlabelled forms would add too much noise to the landmark navigation.

Related issues:

  • Related remote issue: https://github.com/w3c/html-aam/issues/82
  • Analagous issue in this repo, relating to region: #513

Copied from original issue: w3c/aria#514

jnurthen avatar May 21 '18 23:05 jnurthen

From @joanmarie on September 13, 2017 23:7

I don't think we can address this strictly through the Core AAM. The Core AAM states how to expose things from the ARIA spec via platform accessibility APIs. Taking the region role as an example, here's what ARIA 1.1 says:

Authors MUST give each element with role region a brief label that describes the purpose of the content in the region.

In other words, it is author error to use the region role without an accessible name. It just shouldn't happen. But what should user agents expose via platform accessibility APIs in the case of such an author error? That's where the Core AAM comes in.

But things are slightly different for the form role. Again, looking at what ARIA 1.1 says:

Authors SHOULD provide a visible label for the form referenced with aria-labelledby.

It does not say they have to. And the short definition of form in the ARIA 1.1 spec is:

A landmark region that contains a collection of items and objects that, as a whole, combine to create a form.

Nowhere in the ARIA 1.1 spec does it suggest that authors who fail to name their form-role elements are in error or doing anything which will turn those elements into non-landmarks. But if we change the platform mappings for nameless forms as suggested in the opening report, assistive technologies will not include the form in the list of landmarks, and might not even know the author used the form role, instead presenting it to users as if it was just another roleless div element. This assistive technology behavior might not be what the author, who followed the stated requirements of the ARIA spec, expects....

For this reason, I think we need to reach consensus on whether we want to change the ARIA spec to make naming forms an author MUST. If we do, and once that change is in the ARIA spec, then we can state in the Core AAM what user agents need to do when the author fails to name their forms. Because ARIA 1.1 is in CR already, this will need to wait until ARIA 1.2 I'm afraid.

jnurthen avatar May 21 '18 23:05 jnurthen

From @matatk on September 14, 2017 13:41

@joanmarie thanks for your reply. Is this issue thread the correct forum for the discussion that you mention we need to have for 1.2? (I'm keen to contribute to this, as I'd say that, for reasons 1 and 2 above—and that the ATs I've used ignore unlabelled <form>s—this change ought to be made.)

I imagine the best time to bump this will be a short while after 1.1 is published; please could you let me know if here, or somewhere else, is the best place to discuss it? Thanks :-).

jnurthen avatar May 21 '18 23:05 jnurthen

From @joanmarie on September 14, 2017 23:59

@matatk: This is the best place. Should that change, I'll update this issue with the new best place. :smile: And thank you for your interest and help with this matter!

jnurthen avatar May 21 '18 23:05 jnurthen

tests and results I cobbled together today after talking with @matatk about forms/landmarks n' such.

scottaohara avatar Jun 03 '19 18:06 scottaohara

Now that ARIA 1.2 is CR and says authors MUST give form a name (not just SHOULD, as in ARIA 1.1), I will provide a PR for this issue.

The related HTML AAM issue has already been fixed and can be closed: https://github.com/w3c/html-aam/issues/45.

carmacleod avatar Nov 17 '21 23:11 carmacleod

@spectranaut - can we merge this? Are there implementations and tests? (reopening as not merged into stable)

jnurthen avatar Jun 22 '22 22:06 jnurthen

Tests: https://github.com/web-platform-tests/wpt/pull/34758

Implementation:

  • Webkit: Implemented, forms without names are not landmarks
  • Chromium: bug
  • Firefox: bug

spectranaut avatar Jul 08 '22 23:07 spectranaut