-
Notifications
You must be signed in to change notification settings - Fork 125
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
Spec for menu/menuitem does not provide enough author guidance for structure #2300
Comments
Can you provide an example of a parent/child and sibling/child relationship structure? I think it might be useful for better understanding the issue (at least it would be for me). |
Discussion of edge cases and usage patterns in the WG meeting today was complex enough that perhaps we should consider defining a nesting algorithm for menus/submenus, trees, treegrids, etc. taking into account DOM tree, aria-owns, aria-controls, the image map edge case, generic in-betweener elements, and more... |
Discussed in today's meeting: https://www.w3.org/2024/08/22-aria-minutes#t09 However, the exact next steps were not clear and we ran out of time. To pick up next meeting. |
Regarding menus and trees, all of these should be supported equally.
Ideally this wouldn't be dependent on list markup, but rather the role nesting structure. |
How about the following algorithm for finding the name of menu from a menuitem: Starting from menuitem:
|
It does work in these scenarios, but it's very easy to break by changing the nested elements. E.G. By adding a div around the elements within the LI. I don't know what architecture you are running, but do you have to use parent/child/sibling nodes, or can you also use a CSS selector? E.G. From menuitem, move to the containing role=menu, Unfortunately parentNode assumes that both menuitem and menu are siblings in the same direct container, but the search would be more flexible by moving up based on role, then querying again by role. Like I said though, this may be naive since I don't know if this is possible in your code. |
Updated proposal:
|
Adding some examples of current menu implementations that would return the wrong accName if using the ancestor menu > sibling menu item approach, based on what was discussed in the call. I used examples from the open ui menu page, plus the current version of Fluent just because I work on it :D. I left out libraries where the examples didn't include popup menus.
TL:DR: 1 example would return the right name, 5 would not, and 2 are N/A because of the lack of menu semantics. |
Notes from yesterday's WG meeting: https://www.w3.org/2024/08/29-aria-minutes#t04 |
Discussed again in today's meeting: https://www.w3.org/2024/09/05-aria-minutes#t05 Decision was to encourage use of aria-controls or aria-owns in menu or menuitem spec, after some more experimentation between the two options. |
So do we make it an author should? I would vote for aria-controls over
aria-owns personally.
…On Thu, Sep 5, 2024 at 2:19 PM Valerie Young ***@***.***> wrote:
Discussed again in today's meeting:
https://www.w3.org/2024/09/05-aria-minutes#t05
Decision was to encourage use of aria-controls or aria-owns in menu or
menuitem spec, after some more experimentation between the two options.
—
Reply to this email directly, view it on GitHub
<#2300 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKQAZWTGFZRGLHEF3WVOP3ZVCOCPAVCNFSM6AAAAABL2UJWVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZSGM3DSNBWGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Describe your concern
UAs/ATs need a way to determine the parent menuitem that caused a menu to be opened. This is important for Talback on Android, which provides the name of the menu along with the choices.
While the spec does not provide this, somehow the ARIA Authoring Practices Guide does, which says:
"If activating a menuitem opens a submenu, the menuitem is known as a parent menuitem. A submenu's menu element is:
If this is generally followed, it would allow the UA to determine which menuitem opened a given submenu, by navigating from the role="menu" object to the previous sibling in the accessible object tree.
One caveat is that this is also slightly incomplete, because it says "sibling element" instead of "sibling accessible object". Authors should also be able to use aria-owns to create these relationships. The important thing is the final tree structure, not the DOM structure.
Link to the version of the specification or documentation you were looking at at.
https://w3c.github.io/aria/#menuitem
https://w3c.github.io/aria/#menu
https://www.w3.org/WAI/ARIA/apg/patterns/menubar/
Link to documentation:
Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?
Yes
The text was updated successfully, but these errors were encountered: