-
Notifications
You must be signed in to change notification settings - Fork 10
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
Why is a menuitem in a group special, but only on OS X? #78
Comments
@cookiecrook can you help me understand this one? |
Also, a menu button sounds like it should have a drop down, which this doesn't, or does it support that but is undocumented? |
Fixes regression from CL:2142611 where a menuitem inside of a group no longer gets an accessible name. This was due to moving kMenuButton inside the NameFromContents() switch, such that it would no longer get a name from contents. Currently, a role=menuitem inside a role=group gets remapped to kMenuButton via AXObject::RemapAriaRoleDueToParent(). The purpose of remapping menuitem inside of a group to kMenuButton is to expose it as AXMenuButton instead of AXMenuItem on OS, per CORE-AAM. This remapping may be removed in the future, and is an open issue in CORE-AAM. See w3c/core-aam#78 Bug: 1114712 Change-Id: Iae23b2351e72486e1cf3bf4b96ce1ff283e4ad97 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353019 Reviewed-by: Nektarios Paisios <nektar@chromium.org> Commit-Queue: Nektarios Paisios <nektar@chromium.org> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org> Cr-Commit-Position: refs/heads/master@{#797667}
Also, if we keep the rule, maybe it should only be a lone menu item in a group? |
A kMenuButton is a menuitem inside of a group. The Mac mapping is special. Everything else just maps to the platform's menu item role. Without this change, non-Mac platforms announce a menuitem in a group as a menu, when it's actually a menuitem. In the future, the special Mac mapping may change, as it is likely problematic. More info at w3c/core-aam#78 TBR=haraken@chromium.org Bug: 1114712 Change-Id: I3c065f474e235915e5b22569dad08a0e250077f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353431 Commit-Queue: Aaron Leventhal <aleventhal@chromium.org> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org> Reviewed-by: Nektarios Paisios <nektar@chromium.org> Cr-Commit-Position: refs/heads/master@{#798109}
The only guess I have is that the [contained by group | not contained by group ] distinction is a typo that should be referencing menubar versus menu instead of group versus no group. items in a menubar are typically exposed as menu buttons. This is only a guess. |
@cookiecrook, the WebKit code also remaps a role=menuitem inside of a role=group to be a menu button, in remapAriaRoleDueToParent(). Possible bug in implementations and specs? |
If it helps, here is the WebKit commit where it was added, along with the author and reviewers:
Here's the code that was introduced in that commit that does it:
|
Here's an HTML example that shows both Chrome and Safari report "menubutton" w/ VoiceOver.
|
Also, I don't see any mapping in WebKit or Chrome changing a role=menuitem inside of a role=menubar to a menu button. |
In the 2020-08-20 ARIA WG meeting we agreed to remove this advice from core-aam. I've filed the related WebKit bug as https://webkit.org/b/215739 |
Agree that the whole "menu item owned by or child of group" entry should be removed, and the "menuitem not owned by or child of group" entry should just be for "menuitem". Reminder that some tests will need to be rewritten/removed: I almost wonder if it was originally some kind of typo or misunderstanding in the core-aam spec that was propagated to later versions of the spec and also into Chrome. The WAI-ARIA 1.0 User Agent Implementation Guide entry for menuitem has slightly different wording, using the word "option" for some reason (maybe copy/pasted from a special case in option role?):
Someone from Chromium picked up on this "special case" in https://codereview.chromium.org/699083007, in which dmazzoni even said:
and then in a later comment:
I don't know where core-aam bugs were reported back in 2014, so I don't know if the request for clarification was ever filed. Later, "special case" role mappings in the core-aam spec were broken into separate tables, and the word "option" was dropped. The special case was interpreted as belonging to menuitem (which was logical because it was in the entry for menuitem). |
Fixes regression from CL:2142611 where a menuitem inside of a group no longer gets an accessible name. This was due to moving kMenuButton inside the NameFromContents() switch, such that it would no longer get a name from contents. Currently, a role=menuitem inside a role=group gets remapped to kMenuButton via AXObject::RemapAriaRoleDueToParent(). The purpose of remapping menuitem inside of a group to kMenuButton is to expose it as AXMenuButton instead of AXMenuItem on OS, per CORE-AAM. This remapping may be removed in the future, and is an open issue in CORE-AAM. See w3c/core-aam#78 Bug: 1114712 Change-Id: Iae23b2351e72486e1cf3bf4b96ce1ff283e4ad97 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353019 Reviewed-by: Nektarios Paisios <nektar@chromium.org> Commit-Queue: Nektarios Paisios <nektar@chromium.org> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#797667} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: e12d47e157372df244fa13d095c86da967aea8bc
A kMenuButton is a menuitem inside of a group. The Mac mapping is special. Everything else just maps to the platform's menu item role. Without this change, non-Mac platforms announce a menuitem in a group as a menu, when it's actually a menuitem. In the future, the special Mac mapping may change, as it is likely problematic. More info at w3c/core-aam#78 TBR=haraken@chromium.org Bug: 1114712 Change-Id: I3c065f474e235915e5b22569dad08a0e250077f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353431 Commit-Queue: Aaron Leventhal <aleventhal@chromium.org> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org> Reviewed-by: Nektarios Paisios <nektar@chromium.org> Cr-Commit-Position: refs/heads/master@{#798109} GitOrigin-RevId: efbb0a5667b07383dd47ad5c3c65324f8a86f1e0
A menuitem in a group is weird in one way. Spec says that it is exposed as an AXMenuButton instead of an AXMenuItem.
See https://www.w3.org/TR/core-aam-1.2/#details-id-45
Seems bad to me, because:
I'm wondering if we should be fixing this in Chrome (and if so clarifying the specs), or, should it be removed as a thing from CORE-AAM?
The text was updated successfully, but these errors were encountered: