Skip to content
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

[NEW RULE] - ARIA required accessible names - aria-required-accessible-name-gp8n89 #2190

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

giacomo-petri
Copy link
Collaborator

New rule:
The aim of this new rule is to guarantee that ARIA roles requiring an accessible name meet the specified requirements.

Closes issue(s): #2119

Need for Call for Review:
This will require a 2 weeks Call for Review


Pull Request Etiquette

When creating PR:

  • Make sure you're requesting to pull a branch (right side) to the develop branch (left side).
  • Make sure you do not remove the "How to Review and Approve" section in your pull request description

After creating PR:

  • Add yourself (and co-authors) as "Assignees" for PR.
  • Add label to indicate if it's a Rule, Definition or Chore.
  • Link the PR to any issue it solves. This will be done automatically by referencing the issue at the top of this comment in the indicated place.
  • Optionally request feedback from anyone in particular by assigning them as "Reviewers".

When merging a PR:

  • Close any issue that the PR resolves. This will happen automatically upon merging if the PR was correctly linked to the issue, e.g. by referencing the issue at the top of this comment.

How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Call for Review period. In case of disagreement, the longer period wins.

@giacomo-petri giacomo-petri added the Rule Use this label for a new rule that does not exist already label May 10, 2024
@giacomo-petri giacomo-petri self-assigned this May 10, 2024
@giacomo-petri giacomo-petri changed the title Create aria-required-accessible-name-gp8n89.md [NEW RULE] - ARIA required accessible names - aria-required-accessible-name-gp8n89 May 10, 2024
Jym77
Jym77 previously requested changes May 23, 2024
_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
description: |
This rule checks that WAI-ARIA accessible name is available when required.
accessibility_requirements:
aria12:accessible_name_required:
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIrc, the second part is supposed to be the id of an element in the document so we can link to it (https://github.com/act-rules/act-tools/blob/cc2208ac0df7d53748d977cc7813887cbbf6a0fc/src/act/get-accessibility-requirement.ts and https://github.com/act-rules/act-tools/blob/cc2208ac0df7d53748d977cc7813887cbbf6a0fc/src/rule-transform/rule-content/get-requirements-map.ts), which this is not.
OTOH it doesn't look like there actually is a single place where this is defined 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Jym77, exactly. Each role has its own unique requirements, which is why I've given it a general label... I'm uncertain about the best approach to address this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 It seems the WAI website currently doesn't show anything for non-WCAG requirements 🙈 (example), where the old site did (example)…

Not sure why it went away, nor what we want to do. @carlosapaduarte do you have an input on that?

_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
_rules/aria-required-accessible-name-gp8n89.md Outdated Show resolved Hide resolved
Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>

## Applicability

This rule applies to any [HTML or SVG element][] that is [included in the accessibility tree][] and has a [WAI-ARIA 1.2][wai-aria 1.2] [semantic role][] that requires an [accessible name][] either from the [author](https://www.w3.org/TR/wai-aria-1.2/#namefromauthor) or the [content](https://www.w3.org/TR/wai-aria-1.2/#namefromcontent), unless the element has a presentational [explicit semantic role][] leading to a conflict resolved by [Presentational Roles Conflict Resolution][].
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure the "presentational explicit role" exception is even needed 🤔
Because <img src="foo.jpg" role="none" tabindex="0" /> is pretty much bad anyway, no matter that the conflict was trigger to give the final role.
OTOH, might be worth waiting to see what others think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @Jym77,

I think I'm on the same page as you. Initially, the applicability was different, with only explicit roles, and there seemed to be some rationale behind that decision.

However, upon reviewing this matter now, I agree with what you said and I've also come to realize that our definition of semantic roles might not encompass all scenarios. Take, for instance:

<table role="none">
  <tbody>
    <tr>
      <th>Some content</th>
      <td>Some content</td>
    </tr>
  </tbody>
</table>

The th element inherits a presentational role, but as it stands, our current language implies (or at least seems to imply to me) that it holds a semantic role of rowheader, which isn't accurate (and shouldn't mandate an accessible name for this rule).

Lastly, I'm in the process of drafting three new atomic rules for the "Presentational Roles Conflict". They should be finalized soon; I'm just awaiting a response from the ARIA group regarding the last bullet point concerning the conflict of presentational roles, before presenting the PR to our group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rule Use this label for a new rule that does not exist already
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants