aria icon indicating copy to clipboard operation
aria copied to clipboard

Presentational Roles Conflict Resolution - global WAI-ARIA states or properties on inherited presentational roles

Open giacomo-petri opened this issue 1 year ago • 8 comments

Closes: #2233

  • clarified global WAI-ARIA states or properties on inherited presentational roles
  • reorganized the structure of the 3rd bullet to visually and semantically emphasize that the examples below strictly refer to this bullet. The final paragraph related to the author's responsibility is instead applicable to all points.

Preview | Diff

giacomo-petri avatar Jun 07 '24 07:06 giacomo-petri

@giacomo-petri I believe you need to rebase or cherry pick the commit from #2244

pkra avatar Jun 14 '24 10:06 pkra

@pkra, it seems there are other stray end tags...

giacomo-petri avatar Jun 14 '24 12:06 giacomo-petri

Unassigning myself because I don't have the capacity to review a 30,000+ line diff. It won't render on GitHub because it's too large.

cookiecrook avatar Jul 08 '24 22:07 cookiecrook

Unassigning myself because I don't have the capacity to review a 30,000+ line diff. It won't render on GitHub because it's too large.

Hmm yeah - We could probably review this by just looking at the commits (other than the prettier one). But it may be easier to just cherry pick them into a new PR. @spectranaut @pkra do you have any suggestions?

jnurthen avatar Jul 08 '24 23:07 jnurthen

@jnurthen not sure what's going on here. The prettier action should ignore the aria spec but it seems to have formatted it.

We can try reverting the prettier commit. But if the actions are flaky, I'm wondering if it isn't time to bite the bullet and activate prettier on the ARIA spec as well (and update all PRs). Since I did that manually for the PRs from other specs, I should be able to do this for ARIA.

pkra avatar Jul 09 '24 07:07 pkra

Deploy Preview for wai-aria ready!

Name Link
Latest commit c613bbc1493d19d38816928eb59144583e93d263
Latest deploy log https://app.netlify.com/projects/wai-aria/deploys/68f20ef9cfd39f0008ae21b3
Deploy Preview https://deploy-preview-2237--wai-aria.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jul 11 '24 07:07 netlify[bot]

I reversed the prettier commit, rebased on main, and force-pushed here. It looks like this solved the prettier problem.

@giacomo-petri, @jnurthen, @scottaohara, @cookiecrook could please take another look?

pkra avatar Jul 11 '24 07:07 pkra

@giacomo-petri I've rebased on main.

pkra avatar Mar 13 '25 11:03 pkra

@giacomo-petri does this need tests?

spectranaut avatar Jul 31 '25 17:07 spectranaut

  • WPT tests created: https://github.com/web-platform-tests/wpt/pull/54126
  • Results available here: https://wpt.fyi/results/wai-aria/role/role/role_none_conflict_resolution.tentative.html?label=pr_head&max-count=1&pr=54126

Note:

When I originally wrote this PR, I believe browsers were not exposing the roles of children within elements assigned a presentational role. Now that all major browsers do expose the content of such children, should we update the phrasing in this PR from:

Conversely, if the presentational role is inherited

to something like:

Conversely, if the element has a required accessibility parent role and that parent has a presentational role

or something similar?

giacomo-petri avatar Aug 04 '25 09:08 giacomo-petri

@front-endian,

sorry, I wasn't able to work on this earlier. I've revisited this ticket after a couple of weeks (which actually helped), since I was able to review it with a fresh perspective and without the prior context.

I noticed that the second sub-bullet under "If an element has global WAI-ARIA states or properties…" is "out of scope" for that section. The section's description states:

User agents MUST NOT expose elements having explicit or inherited presentational roles in the accessibility tree, with these exceptions.

However, the second sub-bullet says:

User agents MUST NOT expose the element's role,

which contradicts the section's intent (it's not an exception).

I've updated the wording as follows:

  • specified that if an element has global WAI-ARIA states or properties and the presentational role is explicit, user agents MUST ignore the none/presentation role and instead expose the element's implicit role.
  • added a new bullet stating that if an element has only non-global, role-specific WAI-ARIA states or properties, the presentational role is inherited, and an explicit non-presentational role is applied, then user agents MUST ignore the inherited presentational role and instead expose the element's explicit role.
  • Moved the "However…" part into a note, since it's not part of the exceptions.
  • Moved the "Inherited presentational role: User agents MUST NOT expose the element's role…" sentence into a note as well, since this too isn't part of the exceptions.

Note: I've kept the original proposal as Option 1 for reference. The new version is Option 2. If the new proposal addresses everyone's concerns, I'll remove Option 1.

Thanks!

giacomo-petri avatar Oct 17 '25 09:10 giacomo-petri

I recently realized that I also need to address the following case:

<ul role="none">
    <li role="none" aria-describedby="test" data-testname="presentational roles conflict - ul[role=none] &gt; li[aria-describedby]" class="ex-generic">a</li>
    <li aria-describedby="test">b</li>
    <li aria-describedby="test">c</li>
  </ul>

This works as expected across all UA, but the current behavior is not aligned with the specification (both the current one and the version I proposed).

According to the current specifications, the first list item should technically be exposed with a listitem role. However, in practice, all major user agents correctly treat it as presentational, which is also the intended behavior. So I'll need to apply one more small adjustment.

giacomo-petri avatar Nov 12 '25 10:11 giacomo-petri