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

Mappings for form are very confusing, containing infinite logic loop #159

Open
aleventhal opened this issue Jul 26, 2022 · 10 comments
Open

Comments

@aleventhal
Copy link
Contributor

Looking at:

  1. https://w3c.github.io/core-aam/#mapping_role_table
  2. https://w3c.github.io/html-aam/#html-element-role-mappings

When an element with role=form is nameless, core-aam says "Do not expose the element as a landmark. Use the native host language role of the element instead.". This means to use html-aam.

In html-aam, some of the mappings say, "Use WAI-ARIA mapping", which sends us right back to the same place in CORE-AAM, causing a loop. Other mappings are explicity wrt a form with an empty name.

The whole thing is very confusing and difficult to follow.

We're trying to fix https://bugs.chromium.org/p/chromium/issues/detail?id=1343081, but I'm not sure what is required.

@spectranaut @scottaohara

@scottaohara
Copy link
Member

I think the "Use the native host language role of the element instead." of the nameless form table in core aam is probably the part we do not want/need.

Where this ended up, so long after Carolyn had originally made that PR, was to allow a form to still expose a form role if AT felt necessary, but not expose it as a landmark if it was not named.

In HTML AAM, form without a name was originally mapping to generic - but that was removed w3c/html-aam#372

That HTML AAM issue was being tracked against #100 which is still open, and was logged after the merged #97 that is being referenced in the chromium bug.

So seems there are a number of things that were going on here?

@aleventhal
Copy link
Contributor Author

So, we should use ATK_ROLE_FORM only if there is NOT a name, otherwise use ATK_ROLE_LANDMARK. Correct?

Nit: the CORE-AAM table refers to ROLE_FORM when it should say ATK_ROLE_FORM.

@aleventhal
Copy link
Contributor Author

For IA2 nameless forms, what does it mean, "Do not expose the element as a landmark." -- how were we exposing it as a landmark other than via IA2_ROLE_FORM?

And it seems strange that IA2 still exposes it with a form role when there's a name, but ATK does not.

@spectranaut
Copy link
Contributor

spectranaut commented Jul 27, 2022

| Nit: the CORE-AAM table refers to ROLE_FORM when it should say ATK_ROLE_FORM.
Actually it looks like CORE-AAM regularly drops the "ATK_" prefix from the atk/atspi roles, so it is consistent.

I read @carmacleod's comments in this issue: #100

Also it seems to me like we should update CORE-AAM, not HTML-AAM, to:

Form with name (the same except IA2):

  • MSAA + IAccessible2
    • Role: IA2_ROLE_FORM change to IA2_ROLE_LANDMARK
    • Object Attribute: xml-roles:form
  • UIA
    • Control Type: Group
    • Localized Control Type: form
    • Landmark Type: Form
  • ATK/AT-SPI
    • Role: ROLE_LANDMARK
    • Object Attribute: xml-roles:form
  • AX API
    • AXRole: AXGroup
    • AXSubrole: AXLandmarkForm

Form without name should be updated to:

  • MSAA + IAccessible2
    • Role: IA2_ROLE_FORM
    • Object Attribute: xml-roles:form
  • UIA
    • Control Type: Group
    • Localized Control Type: form
  • ATK/AT-SPI
    • Role: ROLE_FORM
    • Object Attribute: xml-roles:form
  • AX API
    • AXRole: AXGroup

If we do this, then we can remove the extra note for ATK from HTML-AAM (https://w3c.github.io/html-aam/#el-form ) because it would be redundant. And then HTML-AAM would point to CORE-AAM, and all the information you need about form mapping (native elements or role forms) would be in once place.

@aleventhal
Copy link
Contributor Author

I guess I don't understand why we should change IA2_ROLE_FORM to IA2_ROLE_LANDMARK when there is a name.
The AT can already determine that there is a landmark from it being an IA2_ROLE_FORM with a name. If we change it to IA2_ROLE_LANDMARK, we make it harder for the AT to determine what kind of landmark it is.

Same with the other APIs, TBH.

@spectranaut
Copy link
Contributor

All the other landmarks in CORE-AAM have IA2_ROLE_LANDMARK so I presume they decipher which landmark by the xml-roles. The change I proposed would make the form landmark consistent with all the other landmarks. I'm not sure if microsoft ATs treat named forms with the role IA2_ROLE_FORM as landmarks.

Here is a test case

@aleventhal
Copy link
Contributor Author

I'll bring this up with various AT devs and ask what they want.
Bottom line is that I think we want a user experience where a nameless form is not in the landmark cycle.
That seems a little weird to me too -- most forms aren't named, and even just knowing where one is might be useful. But I'm sure there was some reasoning behind it. Perhaps there's already a key to navigate to the next form.

@aleventhal
Copy link
Contributor Author

BTW, the Microsoft ATs don't use IA2 at all, they use UIA.

@scottaohara
Copy link
Member

simply linking the issues about this topic w3c/aria#1764

@jcsteh
Copy link

jcsteh commented Feb 27, 2024

We're hitting the same challenge as we try to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1778795. It's actually even worse than is described above though:

  1. Core AAM says that a form without a name should get a computed role of "form".
  2. The Handling Author Errors section of the ARIA spec contradicts this, saying it should fall back to the host language role.
  3. As described here, the host language role maps to the ARIA role.
  4. The WPT test agrees with ARIA's Handling Author Errors here; i.e. role="form" with no name maps to the computed role of the host language, not "form".

I guess I don't understand why we should change IA2_ROLE_FORM to IA2_ROLE_LANDMARK when there is a name.
Same with the other APIs, TBH.

We don't really need that for IA2, but I think that idea came from ATK, where it's much easier to find landmarks by querying for ATK_ROLE_LANDMARK than it is to have a complex query which also checks for named forms.

That seems a little weird to me too -- most forms aren't named, and even just knowing where one is might be useful.

I think it relates to <form> being misused or at least over-used. See #11 (comment). What I can say is that too many landmarks makes landmark navigation worse than useless, though I can't personally speak specifically about nameless forms being landmarks because i haven't done any analysis on that myself.

CC @nmlapre.

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

4 participants