From f84abdeb89ed1d19519ec803594b440bf0e5bf8c Mon Sep 17 00:00:00 2001 From: Timothy Merritt Date: Wed, 7 Oct 2020 08:33:46 -0700 Subject: [PATCH 1/4] fix(aria-roles): Add WAI-ARIA 1.2 roles Adds new roles from WAI-ARIA 1.2 spec Closes issue #2107 --- lib/standards/aria-roles.js | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index cb52d84240..62aec5072a 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -39,11 +39,18 @@ const ariaRoles = { type: 'landmark', allowedAttrs: ['aria-expanded'] }, + blockquote: { + type: 'structure' + }, button: { type: 'widget', allowedAttrs: ['aria-expanded', 'aria-pressed'], nameFromContent: true }, + caption: { + type: 'structure', + requiredContext: ['figure', 'table', 'grid'] + }, cell: { type: 'structure', requiredContext: ['row'], @@ -67,6 +74,9 @@ const ariaRoles = { allowedAttrs: ['aria-checked', 'aria-readonly', 'aria-required'], nameFromContent: true }, + code: { + type: 'structure' + }, columnheader: { type: 'structure', requiredContext: ['row'], @@ -117,6 +127,9 @@ const ariaRoles = { type: 'structure', allowedAttrs: ['aria-expanded'] }, + deletion: { + type: 'structure' + }, dialog: { type: 'widget', allowedAttrs: ['aria-expanded', 'aria-modal'] @@ -131,6 +144,9 @@ const ariaRoles = { type: 'structure', allowedAttrs: ['aria-expanded'] }, + emphasis: { + type: 'structure' + }, feed: { type: 'structure', requiredOwned: ['article'], @@ -191,6 +207,9 @@ const ariaRoles = { input: { type: 'abstract' }, + insertion: { + type: 'structure' + }, landmark: { type: 'abstract' }, @@ -284,6 +303,10 @@ const ariaRoles = { ], nameFromContent: true }, + meter: { + type: 'structure', + requiredAttrs: ['aria-valuemax', 'aria-valuemin', 'aria-valuenow'] + }, navigation: { type: 'landmark', allowedAttrs: ['aria-expanded'] @@ -309,6 +332,9 @@ const ariaRoles = { ], nameFromContent: true }, + paragraph: { + type: 'structure' + }, presentation: { type: 'structure' }, @@ -488,9 +514,18 @@ const ariaRoles = { type: 'widget', allowedAttrs: ['aria-expanded'] }, + strong: { + type: 'structure' + }, structure: { type: 'abstract' }, + subscript: { + type: 'structure' + }, + superscript: { + type: 'structure' + }, switch: { type: 'widget', requiredAttrs: ['aria-checked'], @@ -552,6 +587,9 @@ const ariaRoles = { 'aria-required' ] }, + time: { + type: 'structure' + }, timer: { type: 'widget', allowedAttrs: ['aria-expanded'] From bef75210734a10660ae3a7ab8aecf2e00f245c1b Mon Sep 17 00:00:00 2001 From: Timothy Merritt Date: Wed, 7 Oct 2020 12:52:53 -0700 Subject: [PATCH 2/4] fix(aria-roles): Add WAI-ARIA 1.2 roles to testing Adds new roles from WAI-ARIA 1.2 spec to test/commons/standards/get-aria-roles-by-type.js Closes issue #2107 --- test/commons/standards/get-aria-roles-by-type.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/commons/standards/get-aria-roles-by-type.js b/test/commons/standards/get-aria-roles-by-type.js index 29be9a16f3..a83ffe528e 100644 --- a/test/commons/standards/get-aria-roles-by-type.js +++ b/test/commons/standards/get-aria-roles-by-type.js @@ -14,28 +14,40 @@ describe('standards.getAriaRolesByType', function() { var structureRoles = getAriaRolesByType('structure'); assert.deepEqual(structureRoles, [ 'article', + 'blockquote', + 'caption', 'cell', + 'code', 'columnheader', 'definition', + 'deletion', 'directory', 'document', + 'emphasis', 'feed', 'figure', 'group', 'heading', 'img', + 'insertion', 'list', 'listitem', 'math', + 'meter', 'none', 'note', + 'paragraph', 'presentation', 'row', 'rowgroup', 'rowheader', 'separator', + 'strong', + 'subscript', + 'superscript', 'table', 'term', + 'time', 'toolbar', 'tooltip' ]); From 4dd5fca02552eb1f0b1cdd637fc73297592f78b3 Mon Sep 17 00:00:00 2001 From: Timothy Merritt Date: Wed, 7 Oct 2020 13:00:56 -0700 Subject: [PATCH 3/4] fix(aria-roles): Add allowedAttrs for meter role Adds the allowedAttrs: ['aria-valuetext'] to the meter role Closes issue #2107 --- lib/standards/aria-roles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index 62aec5072a..aeb1e5e9a4 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -305,6 +305,7 @@ const ariaRoles = { }, meter: { type: 'structure', + allowedAttrs: ['aria-valuetext'], requiredAttrs: ['aria-valuemax', 'aria-valuemin', 'aria-valuenow'] }, navigation: { From ecfcda1f26c0695cf6af543e23accdc36d8f1dd3 Mon Sep 17 00:00:00 2001 From: Timothy Merritt Date: Fri, 9 Oct 2020 04:26:28 -0700 Subject: [PATCH 4/4] fix(aria-roles): Add 'treegrid' to caption Adds treegrid to caption role's requiredContext array. Closes issue: #2107 --- lib/standards/aria-roles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index aeb1e5e9a4..95ba637130 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -49,7 +49,7 @@ const ariaRoles = { }, caption: { type: 'structure', - requiredContext: ['figure', 'table', 'grid'] + requiredContext: ['figure', 'table', 'grid', 'treegrid'] }, cell: { type: 'structure',