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

Should form-with-name map to IA2_ROLE_LANDMARK? #100

Open
carmacleod opened this issue Nov 22, 2021 · 6 comments
Open

Should form-with-name map to IA2_ROLE_LANDMARK? #100

carmacleod opened this issue Nov 22, 2021 · 6 comments
Assignees
Milestone

Comments

@carmacleod
Copy link
Contributor

carmacleod commented Nov 22, 2021

When working on #97, I noticed that the MSAA + IAccessible2 mapping for role="form" with an accessible name is IA2_ROLE_FORM. I would have thought it should be mapped to IA2_ROLE_LANDMARK with xml-roles: form, so that it is consistent with all of the other landmark role mappings in MSAA + IAccessible2. It would also be consistent with ATK/AT-SPI's ATK_ROLE_LANDMARK for forms with an accessible name.

Looking through the mailing list archives, it seems that this was discussed but as far as I can tell it was never really resolved?

The point of contention seems to be that HTML <form> has semantics, even if it doesn't have a name. Which is fine, but it doesn't make a nameless form a landmark - only a name can do that. Perhaps nameless HTML <form> should be mapped to IA2_ROLE_FORM so that semantics can be kept if desired. (It is currently mapped to generic role in HTML-AAM). But mapping nameless HTML <form> to IA2_ROLE_FORM would only work if the mapping for named ARIA form role is changed to IA2_ROLE_LANDMARK with xml-roles: form... which is what this issue is about.

@jnurthen jnurthen added this to the 1.3 milestone Dec 2, 2021
@joanmarie
Copy link
Contributor

@feerrenrut and @jcsteh: Thoughts? Thanks in advance!

@carmacleod
Copy link
Contributor Author

Ok, I've done some further thinking on this, and here's what I think makes the most sense.

First, here are my assumptions for how User Agents generally determine the role mapping of an element:

  • If the element has an explicit role, then look up the mappings in CORE-AAM first. In certain specific cases, CORE-AAM may direct you to look at HTML-AAM. For example, "Use the native host language role of the element instead."
  • If the element does not have an explicit role, then look up the mappings in HTML-AAM first. HTML-AAM may direct you to look at CORE-AAM. For example, "Use WAI-ARIA mapping".

So, specifically for form element and form role... if they have a name, we want them to be a landmark. If they don't have a name, we want them to be "just a plain-old form", i.e. something more interesting and useful than "generic".

For role="form" with an accessible name, the CORE-AAM mapping for MSAA+IA2 needs to be IA2_ROLE_LANDMARK with xml-roles: form for consistency with all of the other platforms, as noted in the initial comment of this issue.

The HTML-AAM mappings for form with an accessible name are ok (all platforms map to role="form").

For form element or form role without a name, I think the mappings in CORE-AAM should be the same as they currently are for all platform APIs: "Do not expose the element as a landmark. Use the native host language role of the element instead."

However, I think HTML-AAM needs to provide detailed mappings so that form element without a name is exposed as "just a plain-old form". I think this can be done as follows:

Platform Mapping
[wai-aria-1.2] generic role (or maybe "No corresponding role"?)
MSAA + IAccessible2 Role: IA2_ROLE_FORM
UIA Control Type: Group, Localized Control Type: form
ATK/AT-SPI Role: ROLE_FORM
AX API AXRole: AXForm, AXSubrole: nil

The only one I'm unsure of is AX API, as I can only find references to AXForm role on non-Apple sites. @cookiecrook, could you please help with this? What would the role/subrole pairing be for a plain non-landmark form (other than AXGroup/nil, which could be the backup plan if AXForm doesn't exist, but Apple AT wouldn't know that the element was a form... unless they look at the DOM)? Do you have a current public URL I can go to to find the names for all AX roles and subroles? The closest I can find are NSAccessibility.Role and NSAccessibility.Subrole.

@cookiecrook
Copy link
Contributor

cookiecrook commented Feb 10, 2022

AXRole: AXGroup (already implemented)
AXSubrole: AXLandmarkForm (new)

@carmacleod @scottaohara Will you weigh in on the <form title="foo"> mapping ambiguity comment in https://webkit.org/b/233907?

@jnurthen jnurthen assigned scottaohara and unassigned carmacleod Mar 3, 2022
@cookiecrook
Copy link
Contributor

cookiecrook commented Mar 3, 2022

@carmacleod @scottaohara Will you weigh in on the <form title="foo"> mapping ambiguity comment in https://webkit.org/b/233907?

I'm disappointed to realize today that of all the possible conversations I could have had with Carolyn, this mundane question was the last thing I asked her about. 😢

@scottaohara
Copy link
Member

scottaohara commented Mar 4, 2022

@cookiecrook per your response to Carolyn's question, should I infer that we should not use AXForm and instead stick with AXGroup?

edit: made some updates to html aam. i don't think there's actually anything needed to be updated in core aam at this point? but i just need confirmation per my above question and then i think we're ok?

@cookiecrook
Copy link
Contributor

Yes. WebKit change will be in https://webkit.org/b/233907

AXRole: AXGroup (already implemented)
AXSubrole: AXLandmarkForm (new)

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

5 participants