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

feat(checks): deprecate role-none and role-presentation for presentational-role #2503

Merged
merged 4 commits into from
Sep 8, 2020

Conversation

straker
Copy link
Contributor

@straker straker commented Sep 1, 2020

The presentational-role check is written in such a way that as long as the end role of the element is presentation/none the check will pass. This enables it to be used for things that don't use explicit role to make it presentation, such as an images empty alt attribute. That should help when fixing #2502 so we don't have to check the role in that check.

Also, I removed the presentational check on the link-name rule as there is no way to disable a link from being focusable without a) making it hidden which prevents the rule from running on it or b) removing the href attribute which goes against the selector of the rule.

Closes issue: #2454

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@straker straker requested a review from a team as a code owner September 1, 2020 16:19
@@ -87,6 +87,7 @@ function buildRules(grunt, options, commons, callback) {
var tags = options.tags ? options.tags.split(/\s*,\s*/) : [];
var rules = result.rules;
var checks = result.checks;
parseChecks(checks);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the code, a check's metatdata was only added to axe._load if a rule used it. Since role-none and role-presentation were no longer used in any rule, their metadata was never added. This caused any translation file that passed translations for those checks to fail axe.configure with

"Locale provided for unknown check: "role-none""

To fix I added this line to parse all checks regardless of if a rule uses it or not.

Copy link
Contributor

@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.

minor stuff

lib/checks/shared/presentational-role.json Outdated Show resolved Hide resolved
lib/checks/shared/presentational-role.json Outdated Show resolved Hide resolved
Comment on lines +36 to +41
<iframe
src="frame-title/frames/level1a.html"
id="violation4"
role="none"
aria-live="assertive"
></iframe>
Copy link
Contributor

Choose a reason for hiding this comment

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

We may have to do more work for iframes here later. I don't think this is correct, but we'll get to it when Jey finishes his work on iframes in ACT. Acceptable for now.

straker and others added 2 commits September 3, 2020 08:23
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
@straker straker merged commit cef54a0 into develop Sep 8, 2020
@straker straker deleted the role-conflicit branch September 8, 2020 14:37
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.

2 participants