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: flag unsupported roles #1064

Merged
merged 3 commits into from
Aug 15, 2018
Merged

feat: flag unsupported roles #1064

merged 3 commits into from
Aug 15, 2018

Conversation

marcysutton
Copy link
Contributor

@marcysutton marcysutton commented Aug 10, 2018

Adds unsupported property to the lookupTable.role dictionary. New option for aria.isValidRole to flagUnsupported roles. Defaults to false since this commons function is reused for multiple checks.

Part one of #918.

TODO:

  • Add unsupported to lookupTable.attributes
  • Figure out what to do with globalAttributes, which are currently a flat array
  • Add axe.commons.support API and enable control of it through axe.configure

Reviewer checks

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

  • Follows the commit message policy, appropriate for next version
  • Has documentation updated, a DU ticket, or requires no documentation change
  • Includes new tests, or was unnecessary
  • Code is reviewed for security by: @WilcoFiers

Adds `unsupported` property to the lookupTable.role dictionary. New option for aria.isValidRole to flagUnsupported roles. Defaults to false since this commons function is reused for multiple checks.

TODO: Add `unsupported` to lookupTable.attributes and figure out what to do with globalAttributes

Part of #918
out.push([`${key}`, 'No']);
}
break;
case 'all':
default:
out.push([`${key}`, subject.includes(key) ? 'Yes' : 'No']);
out.push([
`${key}`,
Copy link
Member

Choose a reason for hiding this comment

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

What's this template string for? This could just be out.push(key, ...).

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Agree

Copy link
Contributor 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, that's a question for @JKODU

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@stephenmathieson stephenmathieson Aug 13, 2018

Choose a reason for hiding this comment

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

Right, but why are we wrapping a variable in backticks here? Consider the following:

var a = `${key}`
var b = key

@@ -0,0 +1,11 @@
{
"id": "unsupportedrole",
Copy link
Member

Choose a reason for hiding this comment

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

Should this be hyphenated? unsupported-role is more ascetically pleasing and easier to read (IMO).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following abstractrole and invalidrole, but I could change it.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, makes sense. I'm +1 for consistency, so no need to change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that I'm working on attributes, I wish we would have added a hyphen.... the role thing is inconsistent with the rest of axe-core checks. oh well...

Copy link
Member

@stephenmathieson stephenmathieson left a comment

Choose a reason for hiding this comment

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

Couple of small things. This LGTM tho.

@@ -75,14 +87,11 @@ module.exports = function(grunt) {
} in axe-core.`,
mdTable([
['aria-role', 'axe-core support'],
...getDiff(roles, Object.keys(axe.commons.aria.lookupTable.role))
...getDiff(roles, axe.commons.aria.lookupTable.role)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Object.keys creates an array of just the roles, I needed the whole object.

"impact": "critical",
"messages": {
"pass": "ARIA role is supported",
"fail": "The role used is not widely supported in assistive technologies"
Copy link
Contributor

@WilcoFiers WilcoFiers Aug 14, 2018

Choose a reason for hiding this comment

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

Should this say "in screen readers", or "in screen readers and other assistive technologies"? Also, should we include the actual role?

context: null,
unsupported: false
},
figure: {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add the other properties here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What other properties would apply?

@WilcoFiers WilcoFiers requested a review from a team as a code owner August 14, 2018 15:55
@WilcoFiers WilcoFiers merged commit 5515ee6 into develop Aug 15, 2018
@WilcoFiers WilcoFiers deleted the at-supported-checks branch August 15, 2018 15:00
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.

5 participants