From dabf2947caf3f79280ec50e8c9e4efe1759ba90f Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Thu, 18 Jun 2020 16:40:49 -0600 Subject: [PATCH 01/12] feat(standards): create standards object and ariaAttrs --- lib/core/core.js | 2 + lib/core/public/configure.js | 5 + lib/core/public/reset.js | 4 +- lib/core/public/standards.js | 18 +++ lib/standards/aria-attrs.js | 204 ++++++++++++++++++++++++++++++++++ test/core/public/configure.js | 50 +++++++++ test/core/public/reset.js | 19 ++++ 7 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 lib/core/public/standards.js create mode 100644 lib/standards/aria-attrs.js diff --git a/lib/core/core.js b/lib/core/core.js index 7c777ba946..6a9de5006d 100644 --- a/lib/core/core.js +++ b/lib/core/core.js @@ -27,6 +27,7 @@ import reset from './public/reset'; import runRules from './public/run-rules'; import runVirtualRule from './public/run-virtual-rule'; import run from './public/run'; +import standards from './public/standards'; import naReporter from './reporters/na'; import noPassesReporter from './reporters/no-passes'; @@ -76,6 +77,7 @@ axe.reset = reset; axe._runRules = runRules; axe.runVirtualRule = runVirtualRule; axe.run = run; +axe.standards = standards; axe.commons = commons; axe.utils = utils; diff --git a/lib/core/public/configure.js b/lib/core/public/configure.js index 8022c9df6f..60936a889d 100644 --- a/lib/core/public/configure.js +++ b/lib/core/public/configure.js @@ -1,4 +1,5 @@ import { hasReporter } from './reporter'; +import { configureStandards } from './standards'; function configure(spec) { 'use strict'; @@ -106,6 +107,10 @@ function configure(spec) { if (spec.locale) { audit.applyLocale(spec.locale); } + + if (spec.standards) { + configureStandards(spec.standards); + } } export default configure; diff --git a/lib/core/public/reset.js b/lib/core/public/reset.js index dffe8cb762..830e4d5525 100644 --- a/lib/core/public/reset.js +++ b/lib/core/public/reset.js @@ -1,4 +1,5 @@ -/*global axe */ +import { resetStandards } from './standards'; + function reset() { 'use strict'; var audit = axe._audit; @@ -7,6 +8,7 @@ function reset() { throw new Error('No audit configured'); } audit.resetRulesAndChecks(); + resetStandards(); } export default reset; diff --git a/lib/core/public/standards.js b/lib/core/public/standards.js new file mode 100644 index 0000000000..68fd1d54c1 --- /dev/null +++ b/lib/core/public/standards.js @@ -0,0 +1,18 @@ +import ariaAttrs from '../../standards/aria-attrs'; +import { clone } from '../utils'; + +const standards = { + ariaAttrs +}; + +export function configureStandards(config) { + if (config.ariaAttrs) { + standards.ariaAttrs = Object.assign({}, clone(ariaAttrs), config.ariaAttrs); + } +} + +export function resetStandards() { + standards.ariaAttrs = ariaAttrs; +} + +export default standards; diff --git a/lib/standards/aria-attrs.js b/lib/standards/aria-attrs.js new file mode 100644 index 0000000000..a79401fecb --- /dev/null +++ b/lib/standards/aria-attrs.js @@ -0,0 +1,204 @@ +// Source: https://www.w3.org/TR/wai-aria-1.1/#states_and_properties +const ariaAttrs = { + 'aria-activedescendant': { + type: 'idref', + allowEmpty: true + }, + 'aria-atomic': { + type: 'boolean', + global: true + }, + 'aria-autocomplete': { + type: 'nmtoken', + values: ['inline', 'list', 'both', 'none'] + }, + 'aria-busy': { + type: 'boolean', + global: true + }, + 'aria-checked': { + type: 'nmtoken', + values: ['false', 'mixed', 'true', 'undefined'] + }, + 'aria-colcount': { + type: 'int' + }, + 'aria-colindex': { + type: 'int' + }, + 'aria-colspan': { + type: 'int' + }, + 'aria-controls': { + type: 'idrefs', + allowEmpty: true, + global: true + }, + 'aria-current': { + type: 'nmtoken', + allowEmpty: true, + values: ['page', 'step', 'location', 'date', 'time', 'true', 'false'], + global: true + }, + 'aria-describedby': { + type: 'idrefs', + allowEmpty: true, + global: true + }, + 'aria-describedat': { + unsupported: true, + unstandardized: true + }, + 'aria-details': { + type: 'idref', + allowEmpty: true, + global: true + }, + 'aria-disabled': { + type: 'boolean', + global: true + }, + 'aria-dropeffect': { + type: 'nmtokens', + values: ['copy', 'execute', 'link', 'move', 'none', 'popup'], + global: true + }, + 'aria-errormessage': { + type: 'idref', + allowEmpty: true, + global: true + }, + 'aria-expanded': { + type: 'nmtoken', + values: ['true', 'false', 'undefined'] + }, + 'aria-flowto': { + type: 'idrefs', + allowEmpty: true, + global: true + }, + 'aria-grabbed': { + type: 'nmtoken', + values: ['true', 'false', 'undefined'], + global: true + }, + 'aria-haspopup': { + type: 'nmtoken', + allowEmpty: true, + values: ['true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog'], + global: true + }, + 'aria-hidden': { + type: 'nmtoken', + values: ['true', 'false', 'undefined'], + global: true + }, + 'aria-invalid': { + type: 'nmtoken', + allowEmpty: true, + values: ['grammar', 'false', 'spelling', 'true'], + global: true + }, + 'aria-keyshortcuts': { + type: 'string', + allowEmpty: true, + global: true + }, + 'aria-label': { + type: 'string', + allowEmpty: true, + global: true + }, + 'aria-labelledby': { + type: 'idrefs', + allowEmpty: true, + global: true + }, + 'aria-level': { + type: 'int' + }, + 'aria-live': { + type: 'nmtoken', + values: ['assertive', 'off', 'polite'], + global: true + }, + 'aria-modal': { + type: 'boolean' + }, + 'aria-multiline': { + type: 'boolean' + }, + 'aria-multiselectable': { + type: 'boolean' + }, + 'aria-orientation': { + type: 'nmtoken', + values: ['horizontal', 'undefined', 'vertical'] + }, + 'aria-owns': { + type: 'idrefs', + allowEmpty: true, + global: true + }, + 'aria-placeholder': { + type: 'string', + allowEmpty: true + }, + 'aria-posinset': { + type: 'int' + }, + 'aria-pressed': { + type: 'nmtoken', + values: ['false', 'mixed', 'true', 'undefined'] + }, + 'aria-readonly': { + type: 'boolean' + }, + 'aria-relevant': { + type: 'nmtokens', + values: ['additions', 'all', 'removals', 'text'], + global: true + }, + 'aria-required': { + type: 'boolean' + }, + 'aria-roledescription': { + type: 'string', + allowEmpty: true, + global: true + }, + 'aria-rowcount': { + type: 'int' + }, + 'aria-rowindex': { + type: 'int' + }, + 'aria-rowspan': { + type: 'int' + }, + 'aria-selected': { + type: 'nmtoken', + values: ['false', 'true', 'undefined'] + }, + 'aria-setsize': { + type: 'int' + }, + 'aria-sort': { + type: 'nmtoken', + values: ['ascending', 'descending', 'none', 'other'] + }, + 'aria-valuemax': { + type: 'decimal' + }, + 'aria-valuemin': { + type: 'decimal' + }, + 'aria-valuenow': { + type: 'decimal' + }, + 'aria-valuetext': { + type: 'string' + } +}; + +export default ariaAttrs; diff --git a/test/core/public/configure.js b/test/core/public/configure.js index 773837b2a0..edce3cadd4 100644 --- a/test/core/public/configure.js +++ b/test/core/public/configure.js @@ -908,4 +908,54 @@ describe('axe.configure', function() { }); }); }); + + describe('given a standards object', function() { + beforeEach(function() { + axe._load({}); + }); + + describe('ariaAttrs', function() { + it('should allow creating new attr', function() { + axe.configure({ + standards: { + ariaAttrs: { + newAttr: { + type: 'string' + } + } + } + }); + + var ariaAttr = axe.standards.ariaAttrs.newAttr; + assert.equal(ariaAttr.type, 'string'); + }); + + it('should override existing attr', function() { + axe.configure({ + standards: { + ariaAttrs: { + newAttr: { + type: 'string' + } + } + } + }); + + axe.configure({ + standards: { + ariaAttrs: { + newAttr: { + type: 'mntoken', + values: ['foo', 'bar'] + } + } + } + }); + + var ariaAttr = axe.standards.ariaAttrs.newAttr; + assert.equal(ariaAttr.type, 'mntoken'); + assert.deepEqual(ariaAttr.values, ['foo', 'bar']); + }); + }); + }); }); diff --git a/test/core/public/reset.js b/test/core/public/reset.js index 8210c11919..6871bd2fff 100644 --- a/test/core/public/reset.js +++ b/test/core/public/reset.js @@ -123,4 +123,23 @@ describe('axe.reset', function() { assert.equal(banana.messages.incomplete, 'donno'); }); }); + + it('should restore standards object', function() { + axe._load({}); + + axe.configure({ + standards: { + ariaAttrs: { + 'aria-live': { + type: 'string' + } + } + } + }); + + axe.reset(); + + var ariaLiveAttr = axe.standards.ariaAttrs['aria-live']; + assert.equal(ariaLiveAttr.type, 'nmtoken'); + }); }); From f935157ce1372260b112929e5923a7e0e7ad7a28 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Thu, 18 Jun 2020 16:45:55 -0600 Subject: [PATCH 02/12] removed aria-describedat --- lib/standards/aria-attrs.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/standards/aria-attrs.js b/lib/standards/aria-attrs.js index a79401fecb..0d9e6e0533 100644 --- a/lib/standards/aria-attrs.js +++ b/lib/standards/aria-attrs.js @@ -45,10 +45,6 @@ const ariaAttrs = { allowEmpty: true, global: true }, - 'aria-describedat': { - unsupported: true, - unstandardized: true - }, 'aria-details': { type: 'idref', allowEmpty: true, From df3b7a64ef760b3280f1e1c2dd851e9dae072477 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Mon, 22 Jun 2020 11:48:22 -0600 Subject: [PATCH 03/12] remove public --- lib/core/base/audit.js | 2 ++ lib/core/core.js | 2 -- lib/core/public/configure.js | 2 +- lib/core/public/reset.js | 2 +- lib/core/public/standards.js | 18 ------------------ lib/standards/index.js | 31 +++++++++++++++++++++++++++++++ test/core/public/configure.js | 31 +++++++++++++++++++++++++++++-- test/core/public/reset.js | 2 +- 8 files changed, 65 insertions(+), 25 deletions(-) delete mode 100644 lib/core/public/standards.js create mode 100644 lib/standards/index.js diff --git a/lib/core/base/audit.js b/lib/core/base/audit.js index 6eb1b8feff..a9719d369a 100644 --- a/lib/core/base/audit.js +++ b/lib/core/base/audit.js @@ -1,5 +1,6 @@ import Rule from './rule'; import Check from './check'; +import standards from '../../standards'; import RuleResult from './rule-result'; import { clone, @@ -152,6 +153,7 @@ class Audit { this.tagExclude = ['experimental']; this.lang = 'en'; this.defaultConfig = audit; + this.standards = standards; this._init(); // A copy of the "default" locale. This will be set if the user // provides a new locale to `axe.configure()` and used to undo diff --git a/lib/core/core.js b/lib/core/core.js index 6a9de5006d..7c777ba946 100644 --- a/lib/core/core.js +++ b/lib/core/core.js @@ -27,7 +27,6 @@ import reset from './public/reset'; import runRules from './public/run-rules'; import runVirtualRule from './public/run-virtual-rule'; import run from './public/run'; -import standards from './public/standards'; import naReporter from './reporters/na'; import noPassesReporter from './reporters/no-passes'; @@ -77,7 +76,6 @@ axe.reset = reset; axe._runRules = runRules; axe.runVirtualRule = runVirtualRule; axe.run = run; -axe.standards = standards; axe.commons = commons; axe.utils = utils; diff --git a/lib/core/public/configure.js b/lib/core/public/configure.js index 60936a889d..31f878fbbf 100644 --- a/lib/core/public/configure.js +++ b/lib/core/public/configure.js @@ -1,5 +1,5 @@ import { hasReporter } from './reporter'; -import { configureStandards } from './standards'; +import { configureStandards } from '../../standards'; function configure(spec) { 'use strict'; diff --git a/lib/core/public/reset.js b/lib/core/public/reset.js index 830e4d5525..57aef46b4c 100644 --- a/lib/core/public/reset.js +++ b/lib/core/public/reset.js @@ -1,4 +1,4 @@ -import { resetStandards } from './standards'; +import { resetStandards } from '../../standards'; function reset() { 'use strict'; diff --git a/lib/core/public/standards.js b/lib/core/public/standards.js deleted file mode 100644 index 68fd1d54c1..0000000000 --- a/lib/core/public/standards.js +++ /dev/null @@ -1,18 +0,0 @@ -import ariaAttrs from '../../standards/aria-attrs'; -import { clone } from '../utils'; - -const standards = { - ariaAttrs -}; - -export function configureStandards(config) { - if (config.ariaAttrs) { - standards.ariaAttrs = Object.assign({}, clone(ariaAttrs), config.ariaAttrs); - } -} - -export function resetStandards() { - standards.ariaAttrs = ariaAttrs; -} - -export default standards; diff --git a/lib/standards/index.js b/lib/standards/index.js new file mode 100644 index 0000000000..ced55bf2c8 --- /dev/null +++ b/lib/standards/index.js @@ -0,0 +1,31 @@ +import ariaAttrs from './aria-attrs'; +import { clone } from '../core/utils'; + +const origAriaAttrs = clone(ariaAttrs); +const standards = { + ariaAttrs +}; + +// @see https://stackoverflow.com/a/59008477/2124254 +function merge(current, updates) { + for (const key of Object.keys(updates)) { + if (!current.hasOwnProperty(key) || typeof updates[key] !== 'object') { + current[key] = updates[key]; + } else { + merge(current[key], updates[key]); + } + } + return current; +} + +export function configureStandards(config) { + if (config.ariaAttrs) { + standards.ariaAttrs = merge(ariaAttrs, config.ariaAttrs); + } +} + +export function resetStandards() { + standards.ariaAttrs = origAriaAttrs; +} + +export default standards; diff --git a/test/core/public/configure.js b/test/core/public/configure.js index edce3cadd4..1546c4d3ec 100644 --- a/test/core/public/configure.js +++ b/test/core/public/configure.js @@ -926,7 +926,7 @@ describe('axe.configure', function() { } }); - var ariaAttr = axe.standards.ariaAttrs.newAttr; + var ariaAttr = axe._audit.standards.ariaAttrs.newAttr; assert.equal(ariaAttr.type, 'string'); }); @@ -952,10 +952,37 @@ describe('axe.configure', function() { } }); - var ariaAttr = axe.standards.ariaAttrs.newAttr; + var ariaAttr = axe._audit.standards.ariaAttrs.newAttr; assert.equal(ariaAttr.type, 'mntoken'); assert.deepEqual(ariaAttr.values, ['foo', 'bar']); }); + + it('should merge existing attr', function() { + axe.configure({ + standards: { + ariaAttrs: { + newAttr: { + type: 'mntoken', + values: ['foo', 'bar'] + } + } + } + }); + + axe.configure({ + standards: { + ariaAttrs: { + newAttr: { + type: 'mntokens' + } + } + } + }); + + var ariaAttr = axe._audit.standards.ariaAttrs.newAttr; + assert.equal(ariaAttr.type, 'mntokens'); + assert.deepEqual(ariaAttr.values, ['foo', 'bar']); + }); }); }); }); diff --git a/test/core/public/reset.js b/test/core/public/reset.js index 6871bd2fff..38412fc853 100644 --- a/test/core/public/reset.js +++ b/test/core/public/reset.js @@ -139,7 +139,7 @@ describe('axe.reset', function() { axe.reset(); - var ariaLiveAttr = axe.standards.ariaAttrs['aria-live']; + var ariaLiveAttr = axe._audit.standards.ariaAttrs['aria-live']; assert.equal(ariaLiveAttr.type, 'nmtoken'); }); }); From f07c5117d95095a26173ebe113f99ea59259c714 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 23 Jun 2020 08:45:31 -0600 Subject: [PATCH 04/12] Update lib/standards/index.js Co-authored-by: Wilco Fiers --- lib/standards/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/standards/index.js b/lib/standards/index.js index ced55bf2c8..9796e4d601 100644 --- a/lib/standards/index.js +++ b/lib/standards/index.js @@ -9,7 +9,7 @@ const standards = { // @see https://stackoverflow.com/a/59008477/2124254 function merge(current, updates) { for (const key of Object.keys(updates)) { - if (!current.hasOwnProperty(key) || typeof updates[key] !== 'object') { + if (!current.hasOwnProperty(key) || typeof updates[key] !== 'object' || Array.isArray(current[key])) { current[key] = updates[key]; } else { merge(current[key], updates[key]); From 281317af93d69d99799eaf09de9e7ed4a28ad4a9 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Wed, 24 Jun 2020 14:07:34 -0600 Subject: [PATCH 05/12] test array merge --- test/core/public/configure.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/core/public/configure.js b/test/core/public/configure.js index 1546c4d3ec..6335e4e372 100644 --- a/test/core/public/configure.js +++ b/test/core/public/configure.js @@ -983,6 +983,32 @@ describe('axe.configure', function() { assert.equal(ariaAttr.type, 'mntokens'); assert.deepEqual(ariaAttr.values, ['foo', 'bar']); }); + + it('should override and not merge array', function() { + axe.configure({ + standards: { + ariaAttrs: { + newAttr: { + type: 'mntoken', + values: ['foo', 'bar'] + } + } + } + }); + + axe.configure({ + standards: { + ariaAttrs: { + newAttr: { + values: ['baz'] + } + } + } + }); + + var ariaAttr = axe._audit.standards.ariaAttrs.newAttr; + assert.deepEqual(ariaAttr.values, ['baz']); + }); }); }); }); From 17ce0341134ef0e2da052949ad59c14a8af15223 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Thu, 25 Jun 2020 14:36:15 -0600 Subject: [PATCH 06/12] feat(standards): add ariaRoles standard --- lib/standards/aria-roles.js | 222 ++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 lib/standards/aria-roles.js diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js new file mode 100644 index 0000000000..6c989ce805 --- /dev/null +++ b/lib/standards/aria-roles.js @@ -0,0 +1,222 @@ +// Source: https://www.w3.org/TR/wai-aria-1.1/#roles +// Source: https://www.w3.org/TR/dpub-aria-1.0/ + +/* easiest way to see allowed roles is to filter out the global ones + from the list of inherited states and properties. The dpub spec + does not have the global list so you'll need to copy over from + the wai-aria one: + + const globalAttrs = Array.from( + document.querySelectorAll('#global_states li') + ).map(li => li.textContent.replace(/\s*\(.*\)/, '')); + + const globalRoleAttrs = Array.from( + document.querySelectorAll('.role-inherited li') + ).filter(li => globalAttrs.includes(li.textContent.replace(/\s*\(.*\)/, ''))) + + globalRoleAttrs.forEach(li => li.style.display = 'none'); +*/ +const ariaRoles = { + alert: { + type: 'widget', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'] + }, + alertdialog: { + type: 'widget', + allowedAttrs: ['aria-expanded', 'aria-modal'], + nameFrom: ['author'] + }, + application: { + type: 'landmark', + allowedAttrs: ['aria-activedescendant'], + nameFrom: ['author'] + }, + article: { + type: 'structure', + allowedAttrs: ['aria-posinset', 'aria-setsize', 'aria-expanded'], + nameFrom: ['author'], + implicit: ['article'] + }, + banner: { + type: 'landmark', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'], + implicit: ['header'] + }, + button: { + type: 'widget', + allowedAttrs: ['aria-expanded', 'aria-pressed'], + nameFrom: ['contents', 'author'], + implicit: [ + 'button', + 'input[type="button"]', + 'input[type="image"]', + 'input[type="reset"]', + 'input[type="submit"]', + 'summary' + ] + }, + cell: { + type: 'structure', + owned: ['row'], + allowedAttrs: [ + 'aria-colindex', + 'aria-colspan', + 'aria-rowindex', + 'aria-rowspan', + 'aria-expanded' + ], + nameFrom: ['contents', 'author'], + implicit: ['td', 'th'] + }, + checkbox: { + type: 'widget', + requiredAttrs: ['aria-checked'], + // Note: aria-required is not in the 1.1 spec but is + // consistently supported in ATs and was added in 1.2. + allowedAttrs: ['aria-readonly', 'aria-required'], + nameFrom: ['contents', 'author'], + implicit: ['input[type="checkbox"]'] + }, + columnheader: { + type: 'structure', + context: ['row'], + allowedAttrs: [ + 'aria-sort', + 'aria-colindex', + 'aria-colspan', + 'aria-expanded', + 'aria-readonly', + 'aria-required', + 'aria-rowindex', + 'aria-rowspan', + 'aria-selected' + ], + implicit: ['th'] + }, + combobox: { + type: 'composite', + owned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'], + requiredAttrs: ['aria-expanded'], + // Note: because aria-controls is not well supported we will not + // make it a required attribute even though it is required in the + // spec + allowedAttrs: [ + 'aria-controls', + 'aria-autocomplete', + 'aria-readonly', + 'aria-required', + 'aria-activedescendant', + 'aria-orientation' + ], + nameFrom: ['author'] + }, + command: { + type: 'abstract', + nameFrom: ['author'] + }, + complementary: { + type: 'landmark', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'], + implicit: ['aside'] + }, + composite: { + type: 'abstract', + nameFrom: ['author'] + }, + contentinfo: { + type: 'landmark', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'], + implicit: ['footer'] + }, + definition: { + type: 'structure', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'], + implicit: ['dd', 'dfn'] + }, + dialog: { + type: 'widget', + allowedAttrs: ['aria-expanded', 'aria-modal'], + nameFrom: ['author'], + implicit: ['dialog'] + }, + directory: { + type: 'structure', + allowedAttrs: ['aria-expanded'], + nameFrom: ['contents', 'author'] + }, + document: { + type: 'structure', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'], + implicit: ['body'] + }, + feed: { + type: 'structure', + owned: ['article'], + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'] + }, + figure: { + type: 'structure', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'], + implicit: ['figure'] + }, + form: { + type: 'landmark', + allowedAttrs: ['aria-expanded'], + nameFrom: ['author'], + implicit: ['form'] + }, + grid: { + type: 'composite', + owned: ['row', 'rowgroup'], + allowedAttrs: [ + 'aria-level', + 'aria-multiselectable', + 'aria-readonly', + 'aria-activedescendant', + 'aria-colcount', + 'aria-expanded', + 'aria-rowcount' + ], + nameFrom: ['author'], + implicit: ['table'] + }, + gridcell: { + type: 'widget', + context: ['row'], + allowedAttrs: [ + 'aria-readonly', + 'aria-required', + 'aria-selected', + 'aria-colindex', + 'aria-colspan', + 'aria-expanded', + 'aria-rowindex', + 'aria-rowspan' + ], + nameFrom: ['contents', 'author'], + implicit: ['td', 'th'] + }, + group: { + type: 'structure', + allowedAttrs: ['aria-activedescendant', 'aria-expanded'], + nameFrom: ['author'], + implicit: ['details', 'optgroup'] + }, + heading: { + type: 'structure', + requiredAttrs: ['aria-level'], + allowedAttrs: ['aria-expanded'], + nameFrom: ['contents', 'author'], + implicit: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] + } +}; + +export default ariaRoles; From 286ffaaa03c0926f9590df73fc3e199ec46c4192 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Thu, 25 Jun 2020 14:43:51 -0600 Subject: [PATCH 07/12] comment --- lib/standards/aria-roles.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index 6c989ce805..4d1a9248d3 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -1,5 +1,4 @@ // Source: https://www.w3.org/TR/wai-aria-1.1/#roles -// Source: https://www.w3.org/TR/dpub-aria-1.0/ /* easiest way to see allowed roles is to filter out the global ones from the list of inherited states and properties. The dpub spec From 115b268716a1ace553b023069588bfae09053848 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Fri, 26 Jun 2020 08:54:28 -0600 Subject: [PATCH 08/12] updates --- lib/standards/aria-roles.js | 104 +++++++++++------------------------- 1 file changed, 31 insertions(+), 73 deletions(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index 4d1a9248d3..c4d4b7c3c4 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -18,47 +18,32 @@ const ariaRoles = { alert: { type: 'widget', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'] + allowedAttrs: ['aria-expanded'] }, alertdialog: { type: 'widget', - allowedAttrs: ['aria-expanded', 'aria-modal'], - nameFrom: ['author'] + allowedAttrs: ['aria-expanded', 'aria-modal'] }, application: { type: 'landmark', - allowedAttrs: ['aria-activedescendant'], - nameFrom: ['author'] + allowedAttrs: ['aria-activedescendant'] }, article: { type: 'structure', - allowedAttrs: ['aria-posinset', 'aria-setsize', 'aria-expanded'], - nameFrom: ['author'], - implicit: ['article'] + allowedAttrs: ['aria-posinset', 'aria-setsize', 'aria-expanded'] }, banner: { type: 'landmark', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'], - implicit: ['header'] + allowedAttrs: ['aria-expanded'] }, button: { type: 'widget', allowedAttrs: ['aria-expanded', 'aria-pressed'], - nameFrom: ['contents', 'author'], - implicit: [ - 'button', - 'input[type="button"]', - 'input[type="image"]', - 'input[type="reset"]', - 'input[type="submit"]', - 'summary' - ] + nameFromContent: true }, cell: { type: 'structure', - owned: ['row'], + requiredOwned: ['row'], allowedAttrs: [ 'aria-colindex', 'aria-colspan', @@ -66,8 +51,7 @@ const ariaRoles = { 'aria-rowspan', 'aria-expanded' ], - nameFrom: ['contents', 'author'], - implicit: ['td', 'th'] + nameFromContent: true }, checkbox: { type: 'widget', @@ -75,12 +59,11 @@ const ariaRoles = { // Note: aria-required is not in the 1.1 spec but is // consistently supported in ATs and was added in 1.2. allowedAttrs: ['aria-readonly', 'aria-required'], - nameFrom: ['contents', 'author'], - implicit: ['input[type="checkbox"]'] + nameFromContent: true }, columnheader: { type: 'structure', - context: ['row'], + requiredContext: ['row'], allowedAttrs: [ 'aria-sort', 'aria-colindex', @@ -91,12 +74,11 @@ const ariaRoles = { 'aria-rowindex', 'aria-rowspan', 'aria-selected' - ], - implicit: ['th'] + ] }, combobox: { type: 'composite', - owned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'], + requiredOwned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'], requiredAttrs: ['aria-expanded'], // Note: because aria-controls is not well supported we will not // make it a required attribute even though it is required in the @@ -108,73 +90,55 @@ const ariaRoles = { 'aria-required', 'aria-activedescendant', 'aria-orientation' - ], - nameFrom: ['author'] + ] }, command: { - type: 'abstract', - nameFrom: ['author'] + type: 'abstract' }, complementary: { type: 'landmark', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'], - implicit: ['aside'] + allowedAttrs: ['aria-expanded'] }, composite: { - type: 'abstract', - nameFrom: ['author'] + type: 'abstract' }, contentinfo: { type: 'landmark', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'], - implicit: ['footer'] + allowedAttrs: ['aria-expanded'] }, definition: { type: 'structure', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'], - implicit: ['dd', 'dfn'] + allowedAttrs: ['aria-expanded'] }, dialog: { type: 'widget', - allowedAttrs: ['aria-expanded', 'aria-modal'], - nameFrom: ['author'], - implicit: ['dialog'] + allowedAttrs: ['aria-expanded', 'aria-modal'] }, directory: { type: 'structure', allowedAttrs: ['aria-expanded'], - nameFrom: ['contents', 'author'] + nameFromContent: true }, document: { type: 'structure', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'], - implicit: ['body'] + allowedAttrs: ['aria-expanded'] }, feed: { type: 'structure', - owned: ['article'], - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'] + requiredOwned: ['article'], + allowedAttrs: ['aria-expanded'] }, figure: { type: 'structure', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'], - implicit: ['figure'] + allowedAttrs: ['aria-expanded'] }, form: { type: 'landmark', - allowedAttrs: ['aria-expanded'], - nameFrom: ['author'], - implicit: ['form'] + allowedAttrs: ['aria-expanded'] }, grid: { type: 'composite', - owned: ['row', 'rowgroup'], + requiredOwned: ['row', 'rowgroup'], allowedAttrs: [ 'aria-level', 'aria-multiselectable', @@ -183,13 +147,11 @@ const ariaRoles = { 'aria-colcount', 'aria-expanded', 'aria-rowcount' - ], - nameFrom: ['author'], - implicit: ['table'] + ] }, gridcell: { type: 'widget', - context: ['row'], + requiredContext: ['row'], allowedAttrs: [ 'aria-readonly', 'aria-required', @@ -200,21 +162,17 @@ const ariaRoles = { 'aria-rowindex', 'aria-rowspan' ], - nameFrom: ['contents', 'author'], - implicit: ['td', 'th'] + nameFromContent: true }, group: { type: 'structure', - allowedAttrs: ['aria-activedescendant', 'aria-expanded'], - nameFrom: ['author'], - implicit: ['details', 'optgroup'] + allowedAttrs: ['aria-activedescendant', 'aria-expanded'] }, heading: { type: 'structure', requiredAttrs: ['aria-level'], allowedAttrs: ['aria-expanded'], - nameFrom: ['contents', 'author'], - implicit: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] + nameFromContent: true } }; From 4845d76f6e66925a5db47748fe4feee80c7c3e1c Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Fri, 26 Jun 2020 10:14:33 -0600 Subject: [PATCH 09/12] import changes --- lib/standards/aria-roles.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index c4d4b7c3c4..c6be477251 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -25,8 +25,11 @@ const ariaRoles = { allowedAttrs: ['aria-expanded', 'aria-modal'] }, application: { + // Note: spec difference type: 'landmark', - allowedAttrs: ['aria-activedescendant'] + // Note: aria-expanded is not in the 1.1 spec but is + // consistently supported in ATs and was added in 1.2 + allowedAttrs: ['aria-activedescendant', 'aria-expanded'] }, article: { type: 'structure', @@ -43,7 +46,7 @@ const ariaRoles = { }, cell: { type: 'structure', - requiredOwned: ['row'], + requiredContext: ['row'], allowedAttrs: [ 'aria-colindex', 'aria-colspan', @@ -57,7 +60,7 @@ const ariaRoles = { type: 'widget', requiredAttrs: ['aria-checked'], // Note: aria-required is not in the 1.1 spec but is - // consistently supported in ATs and was added in 1.2. + // consistently supported in ATs and was added in 1.2 allowedAttrs: ['aria-readonly', 'aria-required'], nameFromContent: true }, @@ -74,11 +77,12 @@ const ariaRoles = { 'aria-rowindex', 'aria-rowspan', 'aria-selected' - ] + ], + nameFromContent: true }, combobox: { type: 'composite', - requiredOwned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'], + requiredOwned: ['textbox', 'listbox', 'tree', 'grid', 'dialog'], requiredAttrs: ['aria-expanded'], // Note: because aria-controls is not well supported we will not // make it a required attribute even though it is required in the @@ -116,8 +120,7 @@ const ariaRoles = { }, directory: { type: 'structure', - allowedAttrs: ['aria-expanded'], - nameFromContent: true + allowedAttrs: ['aria-expanded'] }, document: { type: 'structure', @@ -130,7 +133,9 @@ const ariaRoles = { }, figure: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + // Note: spec difference + nameFromContent: true }, form: { type: 'landmark', @@ -138,7 +143,7 @@ const ariaRoles = { }, grid: { type: 'composite', - requiredOwned: ['row', 'rowgroup'], + requiredOwned: ['rowgroup', 'row'], allowedAttrs: [ 'aria-level', 'aria-multiselectable', From 0c91310734d1a0079c3dbca73a6b4fa816719355 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Mon, 29 Jun 2020 10:07:38 -0600 Subject: [PATCH 10/12] finalize and check table --- lib/standards/aria-roles.js | 419 +++++++++++++++++++++++++++++++++++- 1 file changed, 417 insertions(+), 2 deletions(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index c6be477251..429ac58c71 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -58,10 +58,13 @@ const ariaRoles = { }, checkbox: { type: 'widget', - requiredAttrs: ['aria-checked'], + // Note: since the checkbox role has an implicit + // aria-checked=false it is not required to be added by + // the user + // // Note: aria-required is not in the 1.1 spec but is // consistently supported in ATs and was added in 1.2 - allowedAttrs: ['aria-readonly', 'aria-required'], + allowedAttrs: ['aria-checked', 'aria-readonly', 'aria-required'], nameFromContent: true }, columnheader: { @@ -178,6 +181,418 @@ const ariaRoles = { requiredAttrs: ['aria-level'], allowedAttrs: ['aria-expanded'], nameFromContent: true + }, + img: { + type: 'structure', + allowedAttrs: ['aria-expanded'] + }, + input: { + type: 'abstract' + }, + landmark: { + type: 'abstract' + }, + link: { + type: 'widget', + allowedAttrs: ['aria-expanded'], + nameFromContent: true + }, + list: { + type: 'structure', + requiredOwned: ['listitem'], + allowedAttrs: ['aria-expanded'] + }, + listbox: { + type: 'composite', + requiredOwned: ['option'], + allowedAttrs: [ + 'aria-multiselectable', + 'aria-readonly', + 'aria-required', + 'aria-activedescendant', + 'aria-expanded', + 'aria-orientation' + ] + }, + listitem: { + type: 'structure', + requiredContext: ['list'], + allowedAttrs: [ + 'aria-level', + 'aria-posinset', + 'aria-setsize', + 'aria-expanded' + ] + }, + log: { + type: 'widget', + allowedAttrs: ['aria-expanded'] + }, + main: { + type: 'landmark', + allowedAttrs: ['aria-expanded'] + }, + marquee: { + type: 'widget', + allowedAttrs: ['aria-expanded'] + }, + math: { + type: 'structure', + allowedAttrs: ['aria-expanded'] + }, + menu: { + type: 'composite', + requiredOwned: ['menuitemradio', 'menuitem', 'menuitemcheckbox'], + allowedAttrs: ['aria-activedescendant', 'aria-expanded', 'aria-orientation'] + }, + menubar: { + type: 'composite', + requiredOwned: ['menuitemradio', 'menuitem', 'menuitemcheckbox'], + allowedAttrs: ['aria-activedescendant', 'aria-expanded', 'aria-orientation'] + }, + menuitem: { + type: 'widget', + requiredContext: ['menu', 'menubar'], + // Note: aria-expanded is not in the 1.1 spec but is + // consistently supported in ATs and was added in 1.2 + allowedAttrs: ['aria-posinset', 'aria-setsize', 'aria-expanded'], + nameFromContent: true + }, + menuitemcheckbox: { + type: 'widget', + requiredContext: ['menu', 'menubar'], + allowedAttrs: [ + 'aria-checked', + 'aria-posinset', + 'aria-readonly', + 'aria-setsize' + ], + nameFromContent: true + }, + menuitemradio: { + type: 'widget', + requiredContext: ['menu', 'menubar'], + allowedAttrs: [ + 'aria-checked', + 'aria-posinset', + 'aria-readonly', + 'aria-setsize' + ], + nameFromContent: true + }, + navigation: { + type: 'landmark', + allowedAttrs: ['aria-expanded'] + }, + note: { + type: 'structure', + allowedAttrs: ['aria-expanded'] + }, + option: { + type: 'widget', + // Note: since the option role has an implicit + // aria-selected=false it is not required to be added by + // the user + allowedAttrs: [ + 'aria-selected', + 'aria-checked', + 'aria-posinset', + 'aria-setsize' + ], + nameFromContent: true + }, + presentation: { + type: 'structure' + }, + progressbar: { + type: 'widget', + allowedAttrs: [ + 'aria-expanded', + 'aria-valuemax', + 'aria-valuemin', + 'aria-valuenow', + 'aria-valuetext' + ] + }, + radio: { + type: 'widget', + // Note: since the radio role has an implicit + // aria-check=false it is not required to be added by + // the user + // + // Note: aria-required is not in the 1.1 or 1.2 specs but is + // consistently supported in ATs on the individual radio element + allowedAttrs: [ + 'aria-checked', + 'aria-posinset', + 'aria-setsize', + 'aria-required' + ], + nameFromContent: true + }, + radiogroup: { + type: 'composite', + requiredOwned: ['radio'], + allowedAttrs: [ + 'aria-readonly', + 'aria-required', + 'aria-activedescendant', + 'aria-expanded', + 'aria-orientation' + ] + }, + range: { + type: 'abstract' + }, + region: { + type: 'landmark', + allowedAttrs: ['aria-expanded'] + }, + roletype: { + type: 'abstract' + }, + row: { + type: 'structure', + requiredContext: ['grid', 'rowgroup', 'table', 'treegrid'], + requiredOwned: ['cell', 'columnheader', 'gridcell', 'rowheader'], + allowedAttrs: [ + 'aria-colindex', + 'aria-level', + 'aria-rowindex', + 'aria-selected', + 'aria-activedescendant', + 'aria-expanded' + ], + nameFromContent: true + }, + rowgroup: { + type: 'structure', + requiredContext: ['grid', 'table', 'treegrid'], + requiredOwned: ['row'], + nameFromContent: true + }, + rowheader: { + type: 'structure', + requiredContext: ['row'], + allowedAttrs: [ + 'aria-sort', + 'aria-colindex', + 'aria-colspan', + 'aria-expanded', + 'aria-readonly', + 'aria-required', + 'aria-rowindex', + 'aria-rowspan', + 'aria-selected' + ], + nameFromContent: true + }, + scrollbar: { + type: 'widget', + // Note: since the scrollbar role has an implicit + // aria-orientation, aria-valuemax, aria-valuemin, and + // aria-valuenow it is not required to be added by + // the user + // + // Note: because aria-controls is not well supported we will not + // make it a required attribute even though it is required in the + // spec + allowedAttrs: [ + 'aria-controls', + 'aria-orientation', + 'aria-valuemax', + 'aria-valuemin', + 'aria-valuenow', + 'aria-valuetext' + ] + }, + search: { + type: 'landmark', + allowedAttrs: ['aria-expanded'] + }, + searchbox: { + type: 'widget', + allowedAttrs: [ + 'aria-activedescendant', + 'aria-autocomplete', + 'aria-multiline', + 'aria-placeholder', + 'aria-readonly', + 'aria-required' + ] + }, + section: { + type: 'abstract' + }, + sectionhead: { + type: 'abstract' + }, + select: { + type: 'abstract' + }, + separator: { + type: 'structure', + // Note: since the separator role has an implicit + // aria-orientation, aria-valuemax, aria-valuemin, and + // aria-valuenow it is not required to be added by + // the user + allowedAttrs: [ + 'aria-valuemax', + 'aria-valuemin', + 'aria-valuenow', + 'aria-orientation', + 'aria-valuetext' + ] + }, + slider: { + type: 'widget', + // Note: since the slider role has an implicit + // aria-orientation, aria-valuemax, aria-valuemin, and + // aria-valuenow it is not required to be added by + // the user + allowedAttrs: [ + 'aria-valuemax', + 'aria-valuemin', + 'aria-valuenow', + 'aria-orientation', + 'aria-readonly', + 'aria-valuetext' + ] + }, + spinbutton: { + type: 'widget', + // Note: since the spinbutton role has an implicit + // aria-orientation, aria-valuemax, aria-valuemin, and + // aria-valuenow it is not required to be added by + // the user + allowedAttrs: [ + 'aria-valuemax', + 'aria-valuemin', + 'aria-valuenow', + 'aria-readonly', + 'aria-required', + 'aria-activedescendant', + 'aria-valuetext' + ] + }, + status: { + type: 'widget', + allowedAttrs: ['aria-expanded'] + }, + structure: { + type: 'abstract' + }, + switch: { + type: 'widget', + requiredAttrs: ['aria-checked'], + allowedAttrs: ['aria-readonly'], + nameFromContent: true + }, + tab: { + type: 'widget', + requiredContext: ['tablist'], + allowedAttrs: [ + 'aria-posinset', + 'aria-selected', + 'aria-setsize', + 'aria-expanded' + ], + nameFromContent: true + }, + table: { + type: 'structure', + requiredOwned: ['rowgroup', 'row'], + allowedAttrs: ['aria-colcount', 'aria-rowcount', 'aria-expanded'] + }, + tablist: { + type: 'composite', + requiredOwned: ['tab'], + // NOTE: aria-expanded is from the 1.0 spec but is still + // consistently supported in ATs + allowedAttrs: [ + 'aria-level', + 'aria-multiselectable', + 'aria-orientation', + 'aria-activedescendant', + 'aria-expanded' + ] + }, + tabpanel: { + type: 'widget', + allowedAttrs: ['aria-expanded'] + }, + term: { + type: 'structure', + allowedAttrs: ['aria-expanded'] + }, + textbox: { + type: 'widget', + allowedAttrs: [ + 'aria-activedescendant', + 'aria-autocomplete', + 'aria-multiline', + 'aria-placeholder', + 'aria-readonly', + 'aria-required' + ] + }, + timer: { + type: 'widget', + allowedAttrs: ['aria-expanded'] + }, + toolbar: { + type: 'structure', + allowedAttrs: ['aria-orientation', 'aria-activedescendant', 'aria-expanded'] + }, + tooltip: { + type: 'structure', + allowedAttrs: ['aria-expanded'], + nameFromContent: true + }, + tree: { + type: 'composite', + requiredOwned: ['treeitem'], + allowedAttrs: [ + 'aria-multiselectable', + 'aria-required', + 'aria-activedescendant', + 'aria-expanded', + 'aria-orientation' + ] + }, + treegrid: { + type: 'composite', + requiredOwned: ['rowgroup', 'row'], + allowedAttrs: [ + 'aria-activedescendant', + 'aria-colcount', + 'aria-expanded', + 'aria-level', + 'aria-multiselectable', + 'aria-orientation', + 'aria-readonly', + 'aria-required', + 'aria-rowcount' + ] + }, + treeitem: { + type: 'widget', + requiredContext: ['group', 'tree'], + allowedAttrs: [ + 'aria-checked', + 'aria-expanded', + 'aria-level', + 'aria-posinset', + 'aria-selected', + 'aria-setsize' + ], + nameFromContent: true + }, + widget: { + type: 'abstract' + }, + window: { + type: 'abstract' } }; From c9a259c4cd628e69ee33e6c26d8e2c8297b6bd4f Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Mon, 29 Jun 2020 10:15:49 -0600 Subject: [PATCH 11/12] comments --- lib/standards/aria-roles.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index 429ac58c71..e779b16975 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -59,7 +59,7 @@ const ariaRoles = { checkbox: { type: 'widget', // Note: since the checkbox role has an implicit - // aria-checked=false it is not required to be added by + // aria-checked value it is not required to be added by // the user // // Note: aria-required is not in the 1.1 spec but is @@ -291,7 +291,7 @@ const ariaRoles = { option: { type: 'widget', // Note: since the option role has an implicit - // aria-selected=false it is not required to be added by + // aria-selected value it is not required to be added by // the user allowedAttrs: [ 'aria-selected', @@ -317,7 +317,7 @@ const ariaRoles = { radio: { type: 'widget', // Note: since the radio role has an implicit - // aria-check=false it is not required to be added by + // aria-check value it is not required to be added by // the user // // Note: aria-required is not in the 1.1 or 1.2 specs but is @@ -389,9 +389,9 @@ const ariaRoles = { }, scrollbar: { type: 'widget', - // Note: since the scrollbar role has an implicit + // Note: since the scrollbar role has implicit // aria-orientation, aria-valuemax, aria-valuemin, and - // aria-valuenow it is not required to be added by + // aria-valuenow values it is not required to be added by // the user // // Note: because aria-controls is not well supported we will not @@ -432,9 +432,9 @@ const ariaRoles = { }, separator: { type: 'structure', - // Note: since the separator role has an implicit + // Note: since the separator role has implicit // aria-orientation, aria-valuemax, aria-valuemin, and - // aria-valuenow it is not required to be added by + // aria-valuenow values it is not required to be added by // the user allowedAttrs: [ 'aria-valuemax', @@ -446,9 +446,9 @@ const ariaRoles = { }, slider: { type: 'widget', - // Note: since the slider role has an implicit + // Note: since the slider role has implicit // aria-orientation, aria-valuemax, aria-valuemin, and - // aria-valuenow it is not required to be added by + // aria-valuenow values it is not required to be added by // the user allowedAttrs: [ 'aria-valuemax', @@ -461,9 +461,9 @@ const ariaRoles = { }, spinbutton: { type: 'widget', - // Note: since the spinbutton role has an implicit + // Note: since the spinbutton role has implicit // aria-orientation, aria-valuemax, aria-valuemin, and - // aria-valuenow it is not required to be added by + // aria-valuenow values it is not required to be added by // the user allowedAttrs: [ 'aria-valuemax', From d0af335bb2b44ced2027e7d06a56f49356711146 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Mon, 29 Jun 2020 10:35:30 -0600 Subject: [PATCH 12/12] fix nameFromContent --- lib/standards/aria-roles.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index e779b16975..492124e3c7 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -123,7 +123,9 @@ const ariaRoles = { }, directory: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + // Note: spec difference + nameFromContent: true }, document: { type: 'structure', @@ -222,7 +224,9 @@ const ariaRoles = { 'aria-posinset', 'aria-setsize', 'aria-expanded' - ] + ], + // Note: spec difference + nameFromContent: true }, log: { type: 'widget', @@ -422,10 +426,14 @@ const ariaRoles = { ] }, section: { - type: 'abstract' + type: 'abstract', + // Note: spec difference + nameFromContent: true }, sectionhead: { - type: 'abstract' + type: 'abstract', + // Note: spec difference + nameFromContent: true }, select: { type: 'abstract' @@ -523,7 +531,9 @@ const ariaRoles = { }, term: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + // Note: spec difference + nameFromContent: true }, textbox: { type: 'widget',