w3c / aria

Accessible Rich Internet Applications (WAI-ARIA)
https://w3c.github.io/aria/
Other
627 stars 118 forks source link

[Clarification] Presentational Roles Conflict Resolution - global WAI-ARIA states or properties on inherited presentational roles #2233

Open giacomo-petri opened 1 month ago

giacomo-petri commented 1 month ago

In the chapter on Presentational Roles Conflict Resolution, the 3rd bullet states:

If an element has global WAI-ARIA states or properties, user agents MUST ignore the none/presentation role and instead expose the element's implicit role. However, if an element has only non-global, role-specific WAI-ARIA states or properties, the element MUST NOT be exposed unless the presentational role is inherited and an explicit non-presentational role is applied.

Does this also encompass elements with an inherited presentational role? For instance:

<table role="presentation">
  <tbody>
    <tr>
      <td aria-description="Month">January</td>
      <td aria-description="Incoming">$100</td>
    </tr>
    <tr>
      <td aria-description="Month">February</td>
      <td aria-description="Incoming">$80</td>
    </tr>
  </tbody>
</table>

Is the third bullet relevant in this context?

I've observed that most browsers don't expose the td with a cell role (which seems reasonable), but perhaps we should clarify that the third bullet pertains solely to "explicit presentational roles."

spectranaut commented 1 month ago

Might be a duplicate? https://github.com/w3c/aria/issues/1389

giacomo-petri commented 1 month ago

While closely related, the focus of #1389 primarily revolves around "implicit presentational roles" (such as <button><h1 aria-label=1></h1></button>), whereas the current request specifically targets "inherited presentational roles" (<table role="presentation">...</table>).

As outlined in the "Presentational Roles Conflict Resolution" chapter:

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

"implicit presentational roles" are beyond the scope (to determine with #1389 if it is expected or not), while "inherited presentational roles" fall within it.

@spectranaut, for simplicity's sake, since this issue is closely linked to #1389, I'm more than happy to add this bit into the other ticket and closing this one. Let me know if it makes sense or if we want to keep these as 2 separate things.

giacomo-petri commented 3 weeks ago

A few notes as a recap before proceeding with the PR:

Therefore, I will restrict the applicability of the 3rd bullet to elements with an explicit presentational role. I will also clearly specify what user agents must do when encountering a global state or property on an element with an inherited presentational role.