Skip to content

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
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?

Comment on lines 259 to 260


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@giacomo-petri giacomo-petri dismissed stale reviews from colabottles and Jym77 August 1, 2024 16:32

rule updated, please check again. Thanks

Copy link
Member

@carlosapaduarte carlosapaduarte left a comment

Choose a reason for hiding this comment

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

One edit requested and one question to discuss.


#### Failed Example 7

The `button` element has an empty [accessible name][] given by its `aria-labelledby` attribute.
Copy link
Member

Choose a reason for hiding this comment

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

I know it's mentioned in the background, but do we need to have a failed example where all major browsers ignore the accessible name computation rules and do provide the button with an accessible name?

Copy link
Collaborator Author

@giacomo-petri giacomo-petri Jul 24, 2025

Choose a reason for hiding this comment

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

acc name computation is changes and now says:

LabelledBy: Otherwise, if the current node has an aria-labelledby attribute that contains at least one valid IDREF, and the current node is not already part of an ongoing aria-labelledby or aria-describedby traversal, process its IDREFs in the order they occur:

so, let's remove this example!

Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for act-rules ready!

Name Link
🔨 Latest commit b5a2262
🔍 Latest deploy log https://app.netlify.com/projects/act-rules/deploys/6890b6f14adddb0008df1944
😎 Deploy Preview https://deploy-preview-2190--act-rules.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.

@giacomo-petri
Copy link
Collaborator Author

the role="dialog" does no longer require the acc name, as per https://github.com/w3c/aria/pull/2297/files
So I've updated the examples.


For instance, consider a `search` landmark comprising an element with the `form` role, a search label, a search input, and a search submit button. According to ARIA specifications, the `searchbox` role necessitate an [accessible name][]. However, adhering strictly to this rule may lead to repetitive announcements by assistive technologies like screen readers, overwhelming users. Therefore, while this might technically breach ARIA specs, it does not necessarily translate to a violation of WCAG accessibility standards.

Elements subjected to the [Presentational Roles Conflict Resolution][] are not part of this rule and must be tested separately.
Copy link
Collaborator

@dan-tripp-siteimprove dan-tripp-siteimprove Jul 25, 2025

Choose a reason for hiding this comment

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

I'm not sure what to make of this. Does this affect the applicability? If so, does it mean that the applicability should be changed to this:

"... unless the element has a [explicit][explicit semantic role] presentational role which is not to be ignored according to [Presentational Roles Conflict Resolution][]".

?

edit: I just read Inapplicable Example 3, and it seems to contradict my interpretation in my preceding paragraph. Regardless: I get the impression that confliction resolution is a factor in the applicability. If that's true, then that fact should be documented in the applicabililty, not just in the background or examples.

edit number 2: I find is strange that conflict resolution should be a factor in the applicability. Wouldn't it be cleaner to make it not so?

edit number 3: I read some old resolved comments between you and Jean-Yves, and I think I get it now. You really do want to make any element with role="none" and which is subject to conflict resolution inapplicable. That's fine, but I think we can help future confused readers like myself. May I suggest changing this line in the background:

"Elements subjected to the [Presentational Roles Conflict Resolution][] are not part of this rule and must be tested separately."

to this:

"Any element subjected to the [Presentational Roles Conflict Resolution][] is inapplicable under this rule, and must be tested separately. Such an element is inapplicable because it has an [explicit][explicit semantic role] presentational role - even though that presentational role will be ignored by user agents, as a result of conflict resolution."

I don't think we use the term "computed role" around here, but maybe we should consider it at some point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure I'm recalling it exactly, but the idea, especially in light of my proposal for a new rule checking for presentational roles conflict, was to encourage authors to address the presentational roles conflict issue first, rather than simply fixing the name. Once the original error is resolved, next steps can be considered.

I like your rewording suggestion and will apply it.

This `button` element has an [explicit semantic role][] of `none`, leading to a conflict resolved by [Presentational Roles Conflict Resolution][], which is not covered by this rule.

```html
<button role="none">submit</button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I gather there are really two reasons why this button does not have a "computed" role of none: 1) confliction resolution's "element is focusable" clause, and 2) the fact that https://www.w3.org/TR/html-aria/#el-button , third column, does not contain the words "Any role". If I'm right about that, it means that this example is a little weirder than I think you meant it to be. But maybe it doesn't matter - I'll wait to see the outcome of my other comment on conflict resolution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Answered your question above. This example is just to clarify is not in scope for this rule.

Copy link
Member

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

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

@giacomo-petri As discussed, I think we should compare this to existing rules to see which things this covers that we don't already have. We can then decide if we want to exclude those from this rule. Generally we've been trying to avoid overlap between rules - I think I'd prefer we do the same here.

Once we have the list we should put this on the agenda for discussion.

@giacomo-petri
Copy link
Collaborator Author

giacomo-petri commented Aug 7, 2025

I've reviewed the following specifications to help the group better understand the WAI-ARIA direction and intent regarding the reduction of roles that require an acc name:

I compiled a list of all and only the roles that require an accessible name in at least one of these versions. For each role, I noted any changes, such as if it was not originally required but is now, or if it has since been removed from the requirement.

In the final column, I included which of these roles are already covered by our rules, indicating whether we have specific test examples for them or if they are only applicable without associated examples.

ARIA 1.2 Recommendation ARIA 1.3 First Public Working Draft ARIA 1.3 Editor's Draft Already covered by ACT Rules
alertdialog alertdialog does no longer require acc name no
application application application no
button button button 97a4e1 - failed example 3
checkbox checkbox checkbox e086e5 - passed example 7
columnheader columnheader columnheader no
combobox combobox combobox e086e5 - passed example 6
dialog dialog does no longer require acc name no
form form does no longer require acc name no
grid grid does no longer require acc name no
heading heading heading ffd0e9 - all examples (proposed)
img img image 23a2a8 - all examples
link link link c487ae - all examples
listbox listbox listbox e086e5 - no examples
marquee marquee does no longer require acc name no
menuitem menuitem menuitem m6b1q3 - all examples
menuitemcheckbox menuitemcheckbox menuitemcheckbox e086e5 - passed example 8, failed example 8
menuitemradio menuitemradio menuitemradio e086e5 - no examples
meter meter meter no
option option option no
progressbar progressbar progressbar no
radio radio radio e086e5 - no examples
radiogroup radiogroup does no longer require acc name no
region region region no
rowheader rowheader rowheader no
searchbox searchbox searchbox e086e5 - no examples
slider slider slider e086e5 - no examples
spinbutton spinbutton spinbutton e086e5 - no examples
switch switch switch e086e5 - no examples
tab tab tab no
table table does no longer require acc name no
tabpanel tabpanel tabpanel no
textbox textbox textbox e086e5 - failed example 5, failed example 6, failed example 7
tooltip tooltip does no longer require acc name no
tree tree tree no
treegrid treegrid treegrid no
treeitem treeitem treeitem no

I understand your concern, @WilcoFiers, about avoiding duplicates and minimizing secondary requirements. However, I don't see a straightforward way to categorize the remaining missed roles in a clean manner. For example, while many fall under non-operable controls, we are still missing roles like "tab" in other rules, so a category like "ARIA non-UIC" doesn't fully hold up.

I'm inclined to suggest we keep it as is, accepting some overlap, given that ARIA roles inherently impact multiple rules. The alternative would be to explicitly list all the ARIA roles covered by this rule and justify why others were excluded in the background note. But IMO, that approach is more complex and harder for people to digest (and will probably require more maintenance over time).

Open to your thoughts on this.

@carlosapaduarte
Copy link
Member

Decision: Try to group roles in a meaningful way. Create rules for meaningful role groups. As a side effect, discuss the need for names of some of the roles.

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.

7 participants