diff --git a/doc/standards-object.md b/doc/standards-object.md index a439b1ed41..cd34776d96 100644 --- a/doc/standards-object.md +++ b/doc/standards-object.md @@ -67,9 +67,11 @@ The [`ariaRoles`](../lib/standards/aria-roles.js) object defines valid ARIA role - `type` - string(required). [The role type](https://www.w3.org/TR/wai-aria-1.1/#roles_categorization). Valid types are: - `abstract` - - `widget` - - `structure` + - `composite` - `landmark` + - `structure` + - `widget` + - `window` - `requiredContext` - array(optional). List of required parent roles. - `requiredOwned` - array(optional). List of required owned roles. - `requiredAttrs` - array(optional). List of required attributes. diff --git a/lib/checks/aria/valid-scrollable-semantics-evaluate.js b/lib/checks/aria/valid-scrollable-semantics-evaluate.js index 7c3615dbcc..fef446f35e 100644 --- a/lib/checks/aria/valid-scrollable-semantics-evaluate.js +++ b/lib/checks/aria/valid-scrollable-semantics-evaluate.js @@ -16,16 +16,21 @@ const VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = { * appropriate for scrollable elements found in the focus order. */ const VALID_ROLES_FOR_SCROLLABLE_REGIONS = { + alert: true, + alertdialog: true, application: true, article: true, banner: false, complementary: true, contentinfo: true, + dialog: true, form: true, + log: true, main: true, navigation: true, region: true, - search: false + search: false, + status: true }; /** diff --git a/lib/commons/standards/implicit-html-roles.js b/lib/commons/standards/implicit-html-roles.js index 64455b1cb2..b302f0319b 100644 --- a/lib/commons/standards/implicit-html-roles.js +++ b/lib/commons/standards/implicit-html-roles.js @@ -151,6 +151,7 @@ const implicitHtmlRoles = { main: 'main', math: 'math', menu: 'list', + meter: 'meter', nav: 'navigation', ol: 'list', optgroup: 'group', diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index 340fdb9b14..7a6d325773 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -1,4 +1,5 @@ // Source: https://www.w3.org/TR/wai-aria-1.1/#roles +// Source for abstract roles (types): https://www.w3.org/TR/wai-aria/#abstract_roles /* easiest way to see allowed roles is to filter out the global ones from the list of inherited states and properties. The dpub spec @@ -17,13 +18,13 @@ */ const ariaRoles = { alert: { - type: 'widget', + type: 'structure', // Spec difference: Aria-expanded removed in 1.2 allowedAttrs: ['aria-expanded'], superclassRole: ['section'] }, alertdialog: { - type: 'widget', + type: 'window', // Spec difference: Aria-expanded removed in 1.2 allowedAttrs: ['aria-expanded', 'aria-modal'], superclassRole: ['alert', 'dialog'], @@ -119,6 +120,7 @@ const ariaRoles = { nameFromContent: true }, combobox: { + // Note: spec difference type: 'widget', requiredAttrs: ['aria-expanded', 'aria-controls'], allowedAttrs: [ @@ -169,7 +171,7 @@ const ariaRoles = { prohibitedAttrs: ['aria-label', 'aria-labelledby'] }, dialog: { - type: 'widget', + type: 'window', // Spec difference: Aria-expanded removed in 1.2 allowedAttrs: ['aria-expanded', 'aria-modal'], superclassRole: ['window'], @@ -301,6 +303,7 @@ const ariaRoles = { superclassRole: ['section'] }, listbox: { + // Note: spec difference type: 'widget', requiredOwned: ['group', 'option'], allowedAttrs: [ @@ -328,7 +331,7 @@ const ariaRoles = { nameFromContent: true }, log: { - type: 'widget', + type: 'structure', // Spec difference: Aria-expanded removed in 1.2 allowedAttrs: ['aria-expanded'], superclassRole: ['section'] @@ -340,7 +343,7 @@ const ariaRoles = { superclassRole: ['landmark'] }, marquee: { - type: 'widget', + type: 'structure', // Spec difference: Aria-expanded removed in 1.2 allowedAttrs: ['aria-expanded'], superclassRole: ['section'] @@ -696,7 +699,7 @@ const ariaRoles = { accessibleNameRequired: true }, status: { - type: 'widget', + type: 'structure', // Spec difference: Aria-expanded removed in 1.2 allowedAttrs: ['aria-expanded'], superclassRole: ['section'] @@ -816,7 +819,7 @@ const ariaRoles = { superclassRole: ['section'] }, timer: { - type: 'widget', + type: 'structure', // Spec difference: Aria-expanded removed in 1.2 allowedAttrs: ['aria-expanded'], superclassRole: ['status'] diff --git a/test/checks/aria/valid-scrollable-semantics.js b/test/checks/aria/valid-scrollable-semantics.js index 26ea72533a..63c7f1d6fe 100644 --- a/test/checks/aria/valid-scrollable-semantics.js +++ b/test/checks/aria/valid-scrollable-semantics.js @@ -106,6 +106,18 @@ describe('valid-scrollable-semantics', function () { ); }); + it('should return true for role=alertdialog', function () { + var node = document.createElement('div'); + node.setAttribute('role', 'alertdialog'); + fixture.appendChild(node); + flatTreeSetup(fixture); + assert.isTrue( + axe.testUtils + .getCheckEvaluate('valid-scrollable-semantics') + .call(checkContext, node) + ); + }); + it('should return true for role=article', function () { var node = document.createElement('div'); node.setAttribute('role', 'article'); @@ -118,6 +130,18 @@ describe('valid-scrollable-semantics', function () { ); }); + it('should return true for role=dialog', function () { + var node = document.createElement('div'); + node.setAttribute('role', 'dialog'); + fixture.appendChild(node); + flatTreeSetup(fixture); + assert.isTrue( + axe.testUtils + .getCheckEvaluate('valid-scrollable-semantics') + .call(checkContext, node) + ); + }); + it('should return true for nav elements', function () { var node = document.createElement('nav'); fixture.appendChild(node); diff --git a/test/integration/rules/aria-allowed-attr/passes.html b/test/integration/rules/aria-allowed-attr/passes.html index dfef5d3ed5..c1ebea91bf 100644 --- a/test/integration/rules/aria-allowed-attr/passes.html +++ b/test/integration/rules/aria-allowed-attr/passes.html @@ -2118,7 +2118,16 @@
- + + 40 + diff --git a/test/integration/rules/focus-order-semantics/focus-order-semantics.html b/test/integration/rules/focus-order-semantics/focus-order-semantics.html index 7ac09790ae..9e8593a408 100644 --- a/test/integration/rules/focus-order-semantics/focus-order-semantics.html +++ b/test/integration/rules/focus-order-semantics/focus-order-semantics.html @@ -19,6 +19,8 @@

Invalid landmark roles for scrollable containers

+
+

Valid landmark roles for scrollable containers

@@ -31,6 +33,14 @@

Valid landmark roles for scrollable containers

+ +
+
+
+

Valid window roles for scrollable containers

+
+
+

Valid scrollable HTML tags for scrollable regions, not selected by this diff --git a/test/integration/rules/focus-order-semantics/focus-order-semantics.json b/test/integration/rules/focus-order-semantics/focus-order-semantics.json index dac1ba8f13..b9ed3b20c1 100644 --- a/test/integration/rules/focus-order-semantics/focus-order-semantics.json +++ b/test/integration/rules/focus-order-semantics/focus-order-semantics.json @@ -11,12 +11,19 @@ ["#pass7"], ["#pass8"], ["#pass9"], - ["#pass10"] + ["#pass10"], + ["#pass11"], + ["#pass12"], + ["#pass13"], + ["#pass14"], + ["#pass15"] ], "violations": [ ["#violation1"], ["#violation2"], ["#violation3"], - ["#violation4"] + ["#violation4"], + ["#violation5"], + ["#violation6"] ] } diff --git a/test/integration/rules/target-size/target-size.html b/test/integration/rules/target-size/target-size.html index 3c4b0be940..d3cef72ee3 100644 --- a/test/integration/rules/target-size/target-size.html +++ b/test/integration/rules/target-size/target-size.html @@ -28,6 +28,41 @@

+
+ +
Cookies
+
+ +
+ + +
+ +
+ + +
+ +
+ +
Log
+
+ +
+ +
Marquee
+
+ +
+ +
Status
+
+ +
+ +
Timer
+
+