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(standards): add ariaRoles standard #2328

Merged
merged 13 commits into from
Jun 29, 2020
Merged

feat(standards): add ariaRoles standard #2328

merged 13 commits into from
Jun 29, 2020

Conversation

straker
Copy link
Contributor

@straker straker commented Jun 25, 2020

This is the first part of the standards role table. Since there are >100 roles we need to do, I think splitting it out into smaller part will make the review much easier. These are the first 25 roles.

I haven't made any significant changes to the table other than those discussed in the proposal:

  • flattened the attributes object to just be allowedAttrs and requiredAttrs
  • flattened the owned object to just be an array
  • removed the allowedElements property as that will be controlled by the html-elms standards object

As a note, aria-errormessage is a global attribute in the 1.1 spec so isn't listed in any allowedAttrs for that reason.

Lastly, to help with the role table being so large, I think we should split the dpub roles into their own object (dpub-roles) and combine them with the aria-roles object into the standards object. They don't get used a lot and just take up room in the aria table (they're also a different spec).

Part of issues: #2108, #2303, and #2243

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 June 25, 2020 20:41
@straker straker changed the title feat(standards): create standards object and ariaAttrs feat(standards): add ariaRoles standard Jun 25, 2020
lib/standards/aria-roles.js Show resolved Hide resolved
lib/standards/aria-roles.js Outdated Show resolved Hide resolved
lib/standards/aria-roles.js Outdated Show resolved Hide resolved
lib/standards/aria-roles.js Outdated Show resolved Hide resolved
lib/standards/aria-roles.js Outdated Show resolved Hide resolved
WilcoFiers
WilcoFiers previously approved these changes Jun 29, 2020
@straker
Copy link
Contributor Author

straker commented Jun 29, 2020

Now that the structure is finalized I added all the roles to the table, generating the list automatically using a custom script on the 1.0 spec page.

I then created a script to diff the generated file against our current lookup table and modified the output as needed to match (putting comments where and why changes were made).

The final output of the diff contains things I believe we are OK with but am putting here for reference. They are mostly additional aria allowed attrs that the current lookup table did not have but the spec allows.

I tested aria-selected on menuitemradio but it was not supported in JAWS/IE11, NVDA/Firefox, and VO/Safari. The same for aria-selected on radio

====== combobox.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: combobox.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-activedescendant',
     'aria-autocomplete',
     'aria-controls',
     'aria-orientation',
     'aria-readonly',
     'aria-required' ],
  expected:
   [ 'aria-activedescendant',
     'aria-autocomplete',
     'aria-orientation',
     'aria-required' ],
  operator: 'deepEqual' }


====== menuitemcheckbox.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: menuitemcheckbox.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-checked',
     'aria-posinset',
     'aria-readonly',
     'aria-setsize' ],
  expected: [ 'aria-checked', 'aria-posinset', 'aria-setsize' ],
  operator: 'deepEqual' }


====== menuitemradio.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: menuitemradio.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-checked',
     'aria-posinset',
     'aria-readonly',
     'aria-setsize' ],
  expected:
   [ 'aria-checked',
     'aria-posinset',
     'aria-selected',
     'aria-setsize' ],
  operator: 'deepEqual' }


====== radio.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: radio.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-checked',
     'aria-posinset',
     'aria-required',
     'aria-setsize' ],
  expected:
   [ 'aria-checked',
     'aria-posinset',
     'aria-required',
     'aria-selected',
     'aria-setsize' ],
  operator: 'deepEqual' }


====== scrollbar.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: scrollbar.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-controls',
     'aria-orientation',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuenow',
     'aria-valuetext' ],
  expected:
   [ 'aria-orientation',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuetext' ],
  operator: 'deepEqual' }


====== separator.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: separator.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-orientation',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuenow',
     'aria-valuetext' ],
  expected:
   [ 'aria-expanded',
     'aria-orientation',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuenow',
     'aria-valuetext' ],
  operator: 'deepEqual' }


====== slider.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: slider.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-orientation',
     'aria-readonly',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuenow',
     'aria-valuetext' ],
  expected:
   [ 'aria-orientation',
     'aria-readonly',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuetext' ],
  operator: 'deepEqual' }


====== spinbutton.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: spinbutton.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual:
   [ 'aria-activedescendant',
     'aria-readonly',
     'aria-required',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuenow',
     'aria-valuetext' ],
  expected:
   [ 'aria-readonly',
     'aria-required',
     'aria-valuemax',
     'aria-valuemin',
     'aria-valuetext' ],
  operator: 'deepEqual' }


====== switch.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: switch.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual: [ 'aria-readonly' ],
  expected: [],
  operator: 'deepEqual' }


====== table.allowedAttrs ======
{ AssertionError [ERR_ASSERTION]: table.allowedAttrs does not match
    at file:///Users/stevenlambert/deque/axe-core/diff.mjs:55:14
    at ModuleJob.run (internal/modules/esm/module_job.js:95:12)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual: [ 'aria-colcount', 'aria-expanded', 'aria-rowcount' ],
  expected: [ 'aria-colcount', 'aria-rowcount' ],
  operator: 'deepEqual' }

WilcoFiers
WilcoFiers previously approved these changes Jun 29, 2020
@straker straker merged commit 70efbc0 into develop Jun 29, 2020
@straker straker deleted the standards-aria-roles branch June 29, 2020 19:42
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