Skip to content

Update required owned elements and required context role#1454

Merged
spectranaut merged 20 commits into
mainfrom
req-owned-elements
May 1, 2023
Merged

Update required owned elements and required context role#1454
spectranaut merged 20 commits into
mainfrom
req-owned-elements

Conversation

@smhigley

@smhigley smhigley commented Apr 13, 2021

Copy link
Copy Markdown
Contributor

Resolves #1033

Updates "Required Owned Elements" to "Allowed Child Elements", and "Required Context Role" to "Required Parent Role", with added definitions for parent, child, controlled element, and controlling element.

I did some support tests for having intermediate elements in composite widgets, and secondary actions in composite widgets, here: https://cdpn.io/smhigley/debug/vYgLZgK

This is still a POC, so I didn't update all the references to required owned elements/context role. Hopefully that makes it a bit easier to see the relevant diffs for discussion.

Should also resolve #1486

PR merge check list


Preview | Diff


Preview | Diff

@scottaohara scottaohara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is still a draft, just a few comments/suggestions. hope they're helpful

Comment thread common/terms.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
@smhigley

Copy link
Copy Markdown
Contributor Author

I updated the PR based on the comments, updated all references to "required owned elements"/"required context role", and moved the aria-controls allowed child stuff to a separate branch. It should be ready for a full review now.

@smhigley
smhigley marked this pull request as ready for review April 30, 2021 06:02
Comment thread common/terms.html Outdated
Comment thread index.html Outdated
<p>If it is necessary to make multiple additions, modifications, or removals within a container element that is already either partially or fully rendered, authors MAY set <code>aria-busy</code> to <code>true</code> on the container element before the first change, and then set it to <code>false</code> when the last change is complete. For example, if multiple changes to a <a>live region</a> should be spoken as a single unit of speech, authors MAY set <code>aria-busy</code> to <code>true</code> while the changes are being made and then set it to <code>false</code> when the changes are complete and ready to be spoken.</p>
<p>If an element with role <rref>feed</rref> is marked busy, assistive technologies MAY defer rendering changes that occur inside the <code>feed</code> with the exception of user-initiated changes that occur inside the <rref>article</rref> that the user is reading during the busy period.</p>
<p>If changes to a rendered <rref>widget</rref> would create a state where the <rref>widget</rref> is missing <a href="#mustContain">required owned elements</a> during script execution, authors MUST set <code>aria-busy</code> to <code>true</code> on the <rref>widget</rref> during the update process. For example, if a rendered tree grid required a set of simultaneous updates to multiple discontiguous branches, an alternative to replacing the complete tree element with a single update would be to mark the tree busy while each of the branches are modified.</p>
<p>If changes to a rendered <rref>widget</rref> would create a state where the <rref>widget</rref> is modifying <a href="#mustContain">allowed child roles</a> during script execution, authors MAY set <code>aria-busy</code> to <code>true</code> on the <rref>widget</rref> during the update process. For example, if a rendered tree grid required a set of simultaneous updates to multiple discontiguous branches, an alternative to replacing the complete tree element with a single update would be to mark the tree busy while each of the branches are modified.</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just remove this. Does setting aria-busy in this state actually do anything?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to remove it, I just didn't want to muddy this PR with other changes if they'd be controversial 😅

@jnurthen

Copy link
Copy Markdown
Member

Please also move the new terms to index.html. The content of terms.html has been moved there. You'll need to pull the changes from main though to pick this up.

@smhigley
smhigley force-pushed the req-owned-elements branch from 2480d3c to 5607c6c Compare May 13, 2021 17:30
@smhigley

Copy link
Copy Markdown
Contributor Author

All the previous comments should be addressed. @scottaohara / @aleventhal, how does it look now?

@smhigley
smhigley requested a review from cyns May 13, 2021 18:29
@smhigley

Copy link
Copy Markdown
Contributor Author

also pinging @jcsteh because for some reason github isn't letting me add him to the reviewers ¯_(ツ)_/¯

Comment thread index.html Outdated
Comment thread index.html Outdated
<p class="note">An element with a <a href="#subclassroles">subclass role</a> of the 'required owned element' does not fulfill this requirement. For example, the <rref>listbox</rref> role requires ownership of an element using the <rref>option</rref> or <rref>group</rref> role. Although the <rref>group</rref> role is the superclass of <rref>row</rref>, adding an <a>owned</a> element with a role of <rref>row</rref> will not fulfill the requirement that <rref>listbox</rref> owns an <rref>option</rref> or a <rref>group</rref>.</p>
<h3>Allowed Child Roles</h3>
<p>Any <a>element</a> that is a direct <a>child</a> of the element with this <a>role</a>. For example, an element with the role <rref>list</rref> may own elements with the role <rref>listitem</rref>, but not elements with the role <rref>option</rref>.</p>
<p>To determine whether an element is the direct <a>child</a> of a role, <a>user agents</a> MUST ignore any elements with the role <rref>generic</rref> or <rref>presentation</rref>.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely good that we're clarifying what happens concerning generics here. That will clear up implementer confusion like this.

Again, this is clear if you read the definition of "child", but I wonder whether this could be misconstrued as discussing siblings rather than intervening (depth-wise) elements. Perhaps we could clarify this by saying "intervening elements" here?

Also, I assume this isn't a statement about whether intervening generics get exposed in the a11y tree or not, but rather, only a statement about what is considered valid (thus impacting implicit posinset/setsize calculation, etc.)? Pruning intervening generics would be a much bigger change for implementers which would need further discussion.

@smhigley smhigley Jul 1, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to "intervening elements" -- thanks for the suggestion, I like that better :).

And yup! This is guidance on allowed role structure, and isn't prescriptive of API mappings. The only change is implementers would officially need to support e.g. listbox > generic > option (which most already do), but could do so with or without pruning the generic.

@smhigley

Copy link
Copy Markdown
Contributor Author

Just want to ping @jcsteh, @scottaohara, and @aleventhal on this to see if the updates have addressed past comments as desired :)

@scottaohara scottaohara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrote these review comments some time ago... sorry for the delay.

Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread common/terms.html Outdated
Comment thread common/terms.html Outdated
Comment thread index.html Outdated
@jnurthen

jnurthen commented May 2, 2022

Copy link
Copy Markdown
Member

should also resolve #1486

@jnurthen

jnurthen commented Jun 9, 2022

Copy link
Copy Markdown
Member

@smhigley would this PR take care of #1300 ?

@spectranaut

Copy link
Copy Markdown
Contributor

Oh right what was I thinking, we even talked about this. I just got so wrapped up in the "rewrite" and new terms I forgot about this key change XD

Do you want to do that here, or in a follow up issue? If a follow issue, please make one, otherwise, you can add a validator test here.

Comment thread index.html Outdated
Co-authored-by: Adam Page <adamfpage@gmail.com>
@smhigley

Copy link
Copy Markdown
Contributor Author

@spectranaut issue is made! #1917

@spectranaut

Copy link
Copy Markdown
Contributor

@pkra or @jnurthen do you think we can merge this? :)

@spectranaut spectranaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spoke too soon once again! The new CI check caught an errant "may", we need to fix that THEN I think it is ready for merge

Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
jnurthen and others added 2 commits April 26, 2023 13:24
Comment thread index.html Outdated

@jnurthen jnurthen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a #mustContain was missed

Co-authored-by: James Nurthen <jnurthen@users.noreply.github.com>
@spectranaut
spectranaut dismissed stale reviews from cookiecrook and themself May 1, 2023 21:51

outdated

@spectranaut
spectranaut merged commit 232ae78 into main May 1, 2023
github-actions Bot added a commit that referenced this pull request May 1, 2023
SHA: 232ae78
Reason: push, by spectranaut

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
jnurthen pushed a commit that referenced this pull request Oct 10, 2023
Updates "Required Owned Elements" to "Allowed Child Elements", and "Required Context Role" to "Required Parent Role", with added definitions for parent, child, controlled element, and controlling element.
@scottaohara
scottaohara deleted the req-owned-elements branch January 17, 2025 15:59
sideshowbarker added a commit to validator/validator that referenced this pull request May 2, 2026
ARIA 1.2 added "Required Owned Elements" restrictions for several
roles, and ARIA 1.3 clarified them as "Allowed Child Elements" — see
w3c/aria#1454. The check now flags as
non-conforming any element that violates one of the following:

 • role="rowgroup" must contain only role="row"
 • role="group" inside role="menu" or role="menubar" must contain
   only role="menuitem", role="menuitemcheckbox", or
   role="menuitemradio"
 • role="group" inside role="tree" must contain only
   role="treeitem"

Fixes #2078
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

Successfully merging this pull request may close these issues.

Allowed children of role=tablist includes any role including tabpanel? Clarify "required owned element"