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

"Role attribute has valid value" [674b10]: how to enforce WCAG mappings #1862

Closed
wants to merge 3 commits into from

Conversation

Jym77
Copy link
Collaborator

@Jym77 Jym77 commented Jun 16, 2022

Role attribute has valid value has a mapping to 1.3.1 (4.1.2 would be another candidate) which is not always respected. But in man of the cases, a mispelled role is still an accessibility error.

After TF discussion, we tried to remove the mapping in #1854 but this opened concerned from tool vendors that it will effectively remove the rule from the checks that their users care about since they are usually focused on compliance. See also the CG call discussion about removing mappings.

As per the CG call discussion, this tries to add a non-automatable exception to the Expectation to ensure the mapping is correct. I've tried both with 1.3.1 and 4.1.2. The later sounds much better imho, but the mapping is also weaker…

These propositions should likely be taken to the TF for further discussions at some point.

Closes issue(s):

  • N/A

Need for Call for Review:
N/A, this is mostly for opening discussion.


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.

Comment on lines +40 to +46
## Expectation (mapping to 4.1.2)

Each test target either has at least one token which is a valid value corresponding to a non-abstract role from [WAI-ARIA Specifications][]; or the test target is not a [user interface component](https://www.w3.org/TR/WCAG21/#dfn-user-interface-components)

## Expectation (mapping to 1.3.1)

Each test target either has at least one token which is a valid value corresponding to a non-abstract role from [WAI-ARIA Specifications][]; or the test target has not a [structure](https://www.w3.org/TR/WCAG21/#dfn-structure) conveyed through presentation.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Proposing two different versions, depending on the mapping we want to have.
I feel the 4.1.2 version is better, but also that the mapping is weaker (since less roles are UI components).

The 4.1.2 version would accept a mispelled list while the 1.3.1 version would reject it…

Copy link
Member

Choose a reason for hiding this comment

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

I'm struggling to understand how any test target could meet the second part of the expectation version 1.3.1. If the test target must not be programatically hidden then it always have structure conveyed through presentation (because it will always be organised in relation to other parts of the web page).

@Jym77
Copy link
Collaborator Author

Jym77 commented Jun 16, 2022

Side question is whether we want to add examples for these exceptions, knowing that it would effectively prevents automated tools to claim a complete implementation 🤔

## Expectation
## Expectation (mapping to 4.1.2)

Each test target either has at least one token which is a valid value corresponding to a non-abstract role from [WAI-ARIA Specifications][]; or the test target is not a [user interface component](https://www.w3.org/TR/WCAG21/#dfn-user-interface-components)
Copy link
Member

Choose a reason for hiding this comment

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

I think both the UIC and the structure definitions are ambiguous. UIC because it is not clear who is meant by "users", and "structure" for not specifying what "organize" means.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can replace UIC by our definition of Instrument but that would require to define the objective, so I'm not sure it would actually work 😕

@Jym77
Copy link
Collaborator Author

Jym77 commented Jul 7, 2022

Another possibility that we've discussed would be to change the ACT rules format to have both mandatory and optional mappings. For this rule, it would be something like:

Implementation of "Role attribute has valid value" must fail ARIA conformance and may fail 1.3.1 and/or 4.1.2

So, implementation that fail one or the other SC on some or even all test cases would be considered consistent, but implementations that fail 2.1.1 would not be considered consistent.
We could revisit some earlier changes in mapping to get them back as optional mappings.
This could be use elsewhere, for example to fix #1875.

This could also be used to streamline the button/image button rules by removing the "button not image button" exception from "button has accessible name" and having instead a mandatory mapping to 4.1.2 and an optional to 1.1.1.

@dd8
Copy link
Collaborator

dd8 commented Jul 17, 2022

Another possibility that we've discussed would be to change the ACT rules format to have both mandatory and optional mappings. For this rule, it would be something like:

Implementation of "Role attribute has valid value" must fail ARIA conformance and may fail 1.3.1 and/or 4.1.2

That seems like a good solution. It might also solve the mapping problem in #1810 (comment)

Might also be worth considering conditional mappings. For a lot of ARIA issues 4.1.2: Name, Role, Value seems like the best option, but then has problems because it only applies to [user interface components] (https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html#dfn-user-interface-component)

So you could say something like

Must fail 1.3.1 if the widget is visible
Must fail 4.1.2 if the widget is a user interface component

That could also fix #1875. The conditional mapping for an area without alt would be:

Must fail 1.1.1 for area elements

@Jym77
Copy link
Collaborator Author

Jym77 commented Nov 24, 2022

The ACT rule format is moving toward having secondary requirements, which would be a better way to handle this kind of cases. Closing this.

@Jym77 Jym77 closed this Nov 24, 2022
@Jym77 Jym77 deleted the role-attribute-mapping branch November 24, 2022 14:15
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.

4 participants