Repository navigation
Clarify Accessibility Parent-Child Relationships for menu, group, and menuitem - #2483
giacomo-petri wants to merge 32 commits into
Conversation
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Peter Krautzberger <p.krautzberger@gmail.com>
Co-authored-by: Peter Krautzberger <p.krautzberger@gmail.com>
fix typo
|
@np-at to review as well! |
|
actually, taking myself off as a reviewer since we have so many others. |
|
@pkra, I just realized the same issue affects tree/group/treeitem structures. Should we include this change in this PR or create a separate one? |
|
@giacomo-petri sounds good. Hopefully it's simpler since #2094 prevents group as child of tree. |
…weaks * We agreed on introducing the def of "intervening role" later on, but the missing definition causes ambiguity. Therefore, I introduced the "intervening role" concept in the Allowed Accessibility Child Roles and Required Accessibility Parent Role sections. * Use it for group in menu and menubar. * Some editorial fixes (typos and similar).
…nce to avoid changing UA behaviour
|
I've picked this PR up again and tried to make it easier to understand, while also addressing the concerns about the wording raised in some of the previous comments (@pkra, I hope this version is a step forward). Summary of the latest commits:
|
|
The ARIA Working Group just discussed The full IRC log of that discussion<Zakim> agendum 4 -- -> Needs Review - Clarify Accessibility Parent-Child Relationships for menu, group, and menuitem https://github.com//pull/2483 -- taken up [from agendabot]<pkra> jamesn: this is a reminder to review. If you have volunteered, please review. If you're interested, please add yourself. <Daniel> s/I think there will be more info next week./A draft schedule for breakout sessions will be available early next week/ <pkra> giacomo-petri: I've added an intervening role. We had agreed to add it later but it seemed better this way. I've adjusted the definitions. I've updated the role with this. <pkra> ... this makes it some things easier. <Daniel> s/the draft schedule should be ready./When the draft schedule is announced, it would be good for people to take a look and communicate to me any conflicts they see for us to try to address them early enough./ <pkra> jamesn: sounds more substantial. Please take another look. <pkra> ... or let us know if you're unable to. <pkra> spectranaut_: we may need additional ones. <pkra> zakim, next item <Zakim> agendum 5 -- -> Needs Review - Presentational Roles Conflict Resolution - global WAI-ARIA states or properties on inherited presentational roles <Zakim> ... https://github.com//pull/2237 -- taken up [from agendabot] <pkra> jamesn: another PR needing review. <pkra> giacomo-petri: the main point is that I've tried to make the point clearer that UAs must not make them available. <pkra> q+ <pkra> ... and some other changes. <giacomo-petri> q+ <jamesn> Ack pkra <jamesn> Ack giacomo-petri <pkra> pkra: I just wanted to point out that we had discussed removing presentational inheritance. That might impact this. But it's not even drafted yet. <pkra> giacomo-petri: some changes are informed by that thinking, too. <pkra> zakim, next item |
spectranaut
left a comment
There was a problem hiding this comment.
A few small things. Overall I approve, the language is a bit difficult to read but I don't think we can avoid that -- i think it's accurate and the examples make it clear!
| <p>Authors SHOULD use a <code>group</code> to form a logical collection of items in a <a>widget</a>, such as the children of a <rref>treeitem</rref> forming a collection of siblings in a hierarchy. | ||
| Authors MAY nest <code>group</code> elements. However, when a <code>group</code> is used in the context of a <rref>listbox</rref>, for example, authors MUST limit its children to <rref>option</rref> | ||
| elements. Therefore, proper handling of <code>group</code> by authors and assistive technologies is determined by the context in which it is provided.</p> | ||
| <p class="note">In a <rref>menu</rref> or <rref>menubar</rref>, <code>group</code> is an <a>intervening role</a>. Its <a>accessibility children</a> are subject to the same restrictions as the |
There was a problem hiding this comment.
I wonder if these needs to be a note, or if can just be another paragraph.
Co-authored-by: Valerie Young <spectranaut@igalia.com>
Co-authored-by: Valerie Young <spectranaut@igalia.com>
pkra
left a comment
There was a problem hiding this comment.
Re-reviewing this from scratch, I'm still concerned about this change.
I find the new terminology difficult and potentially confusing. It only seems to be introduced to clarify something for role group so I'm wondering why we don't clarify it there instead. Given other issues around groupings, I suspect there may be deeper problems (also in implementations) which this new terminology won't address.
Perhaps we need more group-derivatives (like rowgroup). Perhaps it just boils down to the content model discussion. But I think this needs more discussion.
| </p> | ||
| <p><a>User agents</a> SHOULD ignore the current role if the role of the <a>accessibility parent</a> is not in this list.</p> | ||
| <p>If a role is listed as an <a>intervening role</a>, an element with the current <a>role</a> can be an <a>accessibility child</a> of an element with that intervening role, provided that the | ||
| element with the intervening role, or the outermost one if such elements are nested, is itself an accessibility child of an element with a role from this list that is not an intervening role.</p> |
There was a problem hiding this comment.
I find this sentence difficult to follow.
There was a problem hiding this comment.
I'm finding it difficult to come up with wording that is both precise and clear without making it overly complex.
I’ve split the original sentence into multiple sentences to make the logic easier to follow and reduce the complexity of the wording. I’ve also added examples to illustrate the reasoning.
Hope this helps
| Authors MAY nest <code>group</code> elements. If a section is significant enough to warrant inclusion in the web page's table of contents, the author SHOULD assign it a <a>role</a> of | ||
| <rref>region</rref> or a <a href="#landmark_roles">standard landmark role</a>. | ||
| </p> | ||
| <p>Contrast with <rref>region</rref>, which is a grouping of user interface objects and information that will be included in a page summary or table of contents. If a section is significant enough to |
There was a problem hiding this comment.
Why is the second sentence added here?
| </p> | ||
| <p>Contrast with <rref>region</rref>, which is a grouping of user interface objects and information that will be included in a page summary or table of contents. If a section is significant enough to | ||
| warrant inclusion in the web page's table of contents, the author SHOULD assign it a <a>role</a> of <rref>region</rref> or a <a href="#landmark_roles">standard landmark role</a>.</p> | ||
| <p>Authors SHOULD use a <code>group</code> to form a logical collection of items in a <a>widget</a>, such as the children of a <rref>treeitem</rref> forming a collection of siblings in a hierarchy. |
There was a problem hiding this comment.
This messy paragraph is what this PR is really trying to clean up, no?
There was a problem hiding this comment.
I made a few changes and reordered the content to improve the flow and make the description easier to follow. The intended structure is:
- what a group is (existing content)
- why and when authors should use a group (existing content, but as you said it's hard to follow, so I've re-ordered it)
- when group elements can be nested (new)
- how group contrasts with region (existing content)
- a note clarifying which restrictions apply when group acts as an intervening role (new)
| <a href="#mustContain">allowed accessibility child</a> of a <code>list</code>, but it is a valid descendant if it is also a descendant of the <code>list</code>'s | ||
| <a href="#mustContain">allowed accessibility child</a> <code>listitem</code>. | ||
| </p> | ||
| <p>A role listed in the Allowed Accessibility Child Roles as an <dfn data-export="" data-lt="intervening|intervening role|intervening roles">intervening role</dfn> is allowed as an |
There was a problem hiding this comment.
I don't think data-lt should include "intervening" since that term is used differently in the spec already.
| <a href="#mustContain">allowed accessibility child</a> <code>listitem</code>. | ||
| </p> | ||
| <p>A role listed in the Allowed Accessibility Child Roles as an <dfn data-export="" data-lt="intervening|intervening role|intervening roles">intervening role</dfn> is allowed as an | ||
| <a>accessibility child</a>, and its own <a>accessibility children</a> are also checked against the same list, as if they were accessibility children of the element whose list is |
There was a problem hiding this comment.
I find this sentence difficult to follow.
There was a problem hiding this comment.
I see your point. I've reworded the text into three separate sentences to make the reasoning easier to follow:
- sentence 1 - allowed role: an element with an intervening role is allowed as an acc child
- sentence 2 - checking its acc children: its acc children are checked against the same list as the children of the element that allows the intervening role
- sentence 3 - nesting: the rule also applies when multiple intervening roles are nested
| Authors MUST ensure [=elements=] with <a>role</a> <code>menuitem</code> are <a>accessibility children</a> of an element with role <rref>menu</rref>, <rref>menubar</rref>, or an element | ||
| with role <rref>group</rref> that is an <a>accessibility child</a> of an element with role <rref>menu</rref> or <rref>menubar</rref>. | ||
| Authors MUST ensure [=elements=] with <a>role</a> <code>menuitem</code> have an <a>accessibility ancestor</a> with role <rref>menu</rref> or <rref>menubar</rref>, with only elements of | ||
| role <rref>generic</rref>, <rref>group</rref>, and <rref>none</rref> intervening. |
There was a problem hiding this comment.
This is a good example why I think "intervening role" is possibly confusing. Here, "intervening" is used in the same way it is already used in the spec.
This change also explicitly lists other roles which are permitted as intervening; that's easily confusing and hints at a bigger problem.
Changing from "parent" to "ancestor" here also suggests that the spec's terminology is lacking.
There was a problem hiding this comment.
@pkra, I see your point about the terminology.
My intention was to make the rules explicit about which roles can occur between a required parent role and the current role, while ensuring that nested groups do not bypass the required parent role constraints.
Regarding the distinction between "parent" and "ancestor", the intent is to account for cases where the required role is not the direct accessibility parent, but an ancestor reached through one or more nested groups.
I agree that these concerns may point to a broader issue with how the spec expresses these relationships. If we are not happy with it, I believe we need to discuss alternative approaches before making further changes to the terminology or structure
| <p> | ||
| Authors MUST ensure [=elements=] with <a>role</a> <code>menuitemcheckbox</code> are <a>accessibility children</a> of an element with role <rref>menu</rref>, <rref>menubar</rref>, or an | ||
| element with role <rref>group</rref> that is an <a>accessibility child</a> of an element with role <rref>menu</rref> or <rref>menubar</rref>. | ||
| Authors MUST ensure [=elements=] with <a>role</a> <code>menuitemcheckbox</code> have an <a>accessibility ancestor</a> with role <rref>menu</rref> or <rref>menubar</rref>, with only |
| <p> | ||
| Authors MUST ensure [=elements=] with <a>role</a> <code>menuitemradio</code> are <a>accessibility children</a> of an element with role <rref>menu</rref>, <rref>menubar</rref>, or an | ||
| element with role <rref>group</rref> that is an <a>accessibility child</a> of an element with role <rref>menu</rref> or <rref>menubar</rref>. | ||
| Authors MUST ensure [=elements=] with <a>role</a> <code>menuitemradio</code> have an <a>accessibility ancestor</a> with role <rref>menu</rref> or <rref>menubar</rref>, with only elements |
| <h2>Relationships in the Accessibility Tree</h2> | ||
| <p>The following terms are used to describe relationships between <abbr title="Document Object Model">DOM</abbr> elements.</p> | ||
| <p> | ||
| The <dfn data-export="" data-lt="accessibility ancestor|accessibility ancestors">accessibility ancestors</dfn> of a DOM element are all DOM elements of which the given DOM element is an |
There was a problem hiding this comment.
This should move below "accessibility parent" and re-use "accessibility descendant".
There was a problem hiding this comment.
I wasn't sure which ordering to follow originally, since the definitions were ordered both alphabetically and logically. I've now moved it below accessibility parent so the logical ordering is preserved.
I'm not sure I understand the suggestion to "re-use accessibility descendant" though, since the current definition already uses that term. Could you clarify what you had in mind?
|
@pkra, thanks for taking another look.
I agree that if the new terminology makes the rules harder to understand, I need to reconsider how to explain them. However, I'd also like to put this in context, since the current specification is currently inconsistent, with the allowed-child and required-parent rules effectively contradicting each other in the case of nested groups. Is the proposed approach actually worse than the current situation, where the specification effectively says two opposite things?
The problem is that the current rules for allowed accessibility child roles and required accessibility parent roles are inconsistent for nested groups. Before making further changes, though, I'd like to clarify the problem this PR is trying to address:
Clarifying group in isolation would explain the intended use of the role, but would not resolve that inconsistency in the normative rules (menu, menubar, menuitem, menuitemcheckbox, menuitemradio) that authors and implementers rely on.
I agree that this deserves further discussion, particularly to determine whether the proposed mechanism is the right way to express these relationships or whether a different approach would be more appropriate. I've re-added the agenda label so we can discuss this before making further structural changes. |
Restored definition of accessibility ancestors in the document.
Clarify conditions for intervening roles and accessibility children in the accessibility parent roles section.
🚀 Netlify Preview:
🔄 this PR updates the following specs:
Closes #2438
The current specifications for menu and menubar contradict those for menuitem, menuitemcheckbox, and menuitemradio.
Specifically, the following structure is allowed under the menu role but not when considering the menuitem role:
This PR clarifies that this structure is indeed allowed.
Additionally, it explicitly clarifies in a note that the following example, where a group contains a button and an input as accessibility children, is not permitted. This prevents ambiguity by making it clear that having at least one menuitem as an accessibility child of the group does not justify including other unrelated elements, which was not clearly stated.
This update refines the specifications for menu, menubar, menuitem, menuitemcheckbox, and menuitemradio roles consistently.
Test, Documentation and Implementation tracking
Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.
Preview | Diff