-
Notifications
You must be signed in to change notification settings - Fork 142
Add transparent generic definition and update accessibility parent and child defs #2599
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
base: main
Are you sure you want to change the base?
Conversation
β¦d child to reference it
β Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a formal definition for "transparent elements" and updates accessibility parent/child relationship definitions to use this new terminology instead of the previous ad-hoc references to generic or none/presentation roles. The change clarifies which elements should be ignored when determining accessibility tree relationships.
- Adds a formal definition of "transparent elements" that includes both presentation/none roles and generic elements without accessibility-relevant attributes
- Updates all references to accessibility parent/child relationships to use the new transparent element definition
- Adds live region roles/attributes as an example of semantics that cause accessibility events
Comments suppressed due to low confidence (2)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| <ul> | ||
| <li>Elements that are currently focused, even if the element or one of its ancestor elements has its <sref>aria-hidden</sref> attribute set to <code>true</code>.</li> | ||
| <li>Elements that are a valid target of an <pref>aria-activedescendant</pref> attribute.</li> | ||
| <li>Elements that have <a>live region</a> roles or attributes.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition is editorial, since the section already specifies elements that can fire an accessibility API event. I thought it should be added explicitly since it was the original example that kicked this off (and is probably the other most common attribute authors use that would trigger an a11y event)
spectranaut
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! And I think it is clear.
About whether or not this change is normative -- I'm not sure. In some respects, I think this "transparent" definition is what the "accessible children" work was originally trying to achieve, a case was just missed.
But this change in definition does change "Authors MUST statements", like: Authors MUST only add child element with allowed roles.. Because it changes author MUST statements we should have ACT review.
But it doesn't effect browser implementations right, because we don't specify how to exposes roles outside of their required context?
adampage
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so great, @smhigley. π€© Very helpful to have a clear term βΒ dad joke intended. π€
Co-authored-by: Valerie Young <[email protected]> Co-authored-by: Adam Page <[email protected]>
|
@spectranaut thanks for the review! For this:
That's also my understanding, it doesn't affect browser implementations b/c we don't specify how to expose the intervening generics, and also this should bring the spec in line with the current behavior (i.e. aria-live on an intervening generic didn't work). |
|
π Deployed on https://deploy-preview-2599--wai-aria.netlify.app |
Co-authored-by: Peter Krautzberger <[email protected]>
pkra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to discuss an alternative to this addition. I suspect adding another definition is not as helpful. Instead, I would
- add the information on when generics are excluded to Section 7.1
- reduce the list for accessibility tree "candidates" to just 2 - DOM descendants and aria-own (descendants)
- add more notes as needed
- remove the extraneous stuff in the definition of accessibility parent
| example, an element with the role <rref>list</rref> allows <a>accessibility children</a> with the role <rref>listitem</rref>, but does not allow <a>accessibility children</a> with the role | ||
| <rref>option</rref>. | ||
| </p> | ||
| <p>To determine whether an element is the <a>accessibility child</a> of an element, <a>user agents</a> MUST ignore any intervening elements with the role <rref>generic</rref> or <rref>none</rref> which are <a>transparent</a>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems redundant (now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, I know transparent is also in the definition of acc child, but this is the only place with browser MUST wording related to it
| <section id="tree_relationships"> | ||
| <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>A <dfn data-export="" data-lt="transparent|transparent element|transparent elements">transparent element</dfn> is an element that meets one of the following criteria:</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On revisiting this a year later, I'm not sure about this additional definition anymore.
| <p>A <dfn data-export="" data-lt="transparent|transparent element|transparent elements">transparent element</dfn> is an element that meets one of the following criteria:</p> | ||
| <ul> | ||
| <li>It has a role of <rref>presentation</rref> or <rref>none</rref>, and does not meet one of the exceptions documented in the <a href="#conflict_resolution_presentation_none">Presentational Roles Conflict Resolution</a> section.</li> | ||
| <li>It is a <rref>generic</rref> element that does not have any attributes such as <pref>aria-live</pref> that would require it to be included in the accessibility tree, as covered in <a href="#tree_inclusion">Including Elements in the Accessibility Tree</a>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be simpler to add this rule for generics to the list at the beginning of Section 7.1 instead (adding the same sentence we have in the item for role=none that descendants are not excluded).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that this category of "transparent" elements are distinct from both generics (which may or may not be in the a11y tree at the browser's discretion), and elements which must be excluded entirely, which are outlined in 7.1.
This addition is specifically for elements that do not interfere with parent/chlid relations, but do not rise to the level of MUST NOT or SHOULD NOT a11y tree exclusion. When we were discussing the original a11y parent/child work, I remember some browser folks being clear that this should not add a new requirement for whether the intervening generics are part of the a11y tree; the only requirement is that they do not interfere with e.g. list/listitem or listbox/option hierarchy.
| <ul> | ||
| <li>The <abbr title="Document Object Model">DOM</abbr> children of the <a>element</a>.</li> | ||
| <li>All DOM descendants of the <a>element</a> with only elements of role <rref>generic</rref> or <rref>none</rref> intervening.</li> | ||
| <li>All DOM descendants of the <a>element</a> with only <a>transparent elements</a> intervening.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then here we would only have to say "DOM descendants that are not excluded as per Section 7.1".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we don't even have to say that much since this list is preceded by "with exclusions listed below" and those exclusions follow immediately after.
| <li> | ||
| All DOM descendants of an element with role <rref>generic</rref> or <rref>none</rref> specified via <pref>aria-owns</pref> with only elements of role <rref>generic</rref> or | ||
| <rref>none</rref> intervening. | ||
| All DOM descendants of an element with role <rref>generic</rref> or <rref>none</rref> specified via <pref>aria-owns</pref> with only <a>transparent elements</a> intervening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph was already redundant, I think.
| @@ -16246,10 +16253,10 @@ <h2>Relationships in the Accessibility Tree</h2> | |||
| </p> | |||
| <ul> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this entire list should be removed as redundant. As shown here, it only adds maintenance burden.
|
@smhigley sorry for changing my mind a year later π I'll volunteer if we decide on a different direction. |
4d60517 to
f88ce37
Compare
π Netlify Preview:
π this PR updates the following sspecs:
Closes #2423
Updates the accessibility parent/child relationships to reference "transparent" elements rather than simply generics or
role="none/presentation". Transparent is defined based on the language in the previous section (including elements in the a11y tree), and I added an explicit reference to live regions in the examples of semantics that cause an accessibility event.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