From d4799c66e4dca7ea077751f81d3a0722d7ccd9d4 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 30 Mar 2023 13:25:10 +0200 Subject: [PATCH 1/6] new rule: ARIA required ID references exist --- _rules/aria-required-id-references-in6db8.md | 191 +++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 _rules/aria-required-id-references-in6db8.md diff --git a/_rules/aria-required-id-references-in6db8.md b/_rules/aria-required-id-references-in6db8.md new file mode 100644 index 0000000000..db65d1192f --- /dev/null +++ b/_rules/aria-required-id-references-in6db8.md @@ -0,0 +1,191 @@ +--- +id: in6db8 +name: ARIA required ID references exist +rule_type: atomic +description: | + This rule checks that every ID reference required by WAI-ARIA exists +accessibility_requirements: + aria12:propcharacteristic_value: + title: ARIA 1.2, 6.2.4 Value (Characteristics of States and Properties) + forConformance: true + failed: not satisfied + passed: satisfied + inapplicable: satisfied + wcag20:1.3.1: # Info and Relationships (A) + secondary: true + wcag20:4.1.2: # Name, Role, Value (A) + secondary: true +input_aspects: + - DOM Tree + - CSS Styling +acknowledgments: + authors: + - Wilco Fiers +--- + +## Applicability + +This rule applies to any HTML element with an `aria-controls` attribute for which one of the following is true: + +- expanded combobox: the element is a [semantic][] `combobox` with an `aria-expanded` [attribute value][] of `true`; or +- scrollbar: the element is a [semantic][] `scrollbar`. + +## Expectation + +Each test target's [attribute value][] an space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [document][document tree] or [shadow tree][]. + +## Assumptions + +There are no assumptions. + +## Accessibility Support + +Some user agents treat the value of `aria-*` attribute as case-sensitive (even when these are not IDs) while some treat them as case-insensitive. + +## Background + +This rule is written specifically for `aria-controls`, because it is the only [ID Reference List][] property that is [required by WAI-ARIA][]. The `aria-controls` property is only required by the `scrollbar` role, and by an expanded `combobox`. There are no [ID Reference][] properties that are required by WAI-ARIA for any role. + +### Bibliography + +- [ARIA5: Using WAI-ARIA state and property attributes to expose the state of a user interface component](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA5) +- [WAI-ARIA required states and properties](https://www.w3.org/TR/wai-aria-1.2/#requiredState) +- [RFC 3986](https://www.ietf.org/rfc/rfc3986.txt) + +## Test Cases + +### Passed + +#### Passed Example 1 + +The `aria-controls` [attribute value][] of this `scrollbar` matches the `id` of the `main` element in the same document. + +```html +
Lorem ipsum...
+
+``` + +#### Passed Example 2 + +The `aria-controls` [attribute value][] of this expanded `combobox` matches the `id` of the `main` element in the same document. + +```html + + + +``` + +#### Passed Example 3 + +The `aria-controls` [attribute value][] of this `scrollbar` has two IDs. The `content-2` ID matches the `id` of the `main` element in the same document. + +```html +
Lorem ipsum...
+
+``` + +### Failed + +#### Failed Example 1 + +The `aria-controls` attribute of this expanded `combobox` references an ID of `popup_listbox` which does not exist in the document. + +```html + +``` + +#### Failed Example 2 + +The `aria-controls` attribute of this `scrollbar` references IDs of `content-1` and `content-2`. Neither of these IDs exist in the document. + +```html +
Lorem ipsum...
+
+``` + +#### Failed Example 3 + +The `aria-controls` attribute of this expanded `combobox` references a `popup_listbox` ID. This `id` exists, but in a different DOM tree as the `combobox`. + +```html + + + + + + +``` + +### Inapplicable + +#### Inapplicable Example 1 + +The `combobox` does not have an `aria-expanded` [attribute value][] of `true`. + +```html + + +``` + +#### Inapplicable Example 2 + +The `aria-controls` attribute is not required on a `button`. + +```html + +``` + +[semantic]: #semantic-role 'Definition of Semantic Role' +[attribute value]: #attribute-value 'Definition of Attribute Value' +[document tree]: https://dom.spec.whatwg.org/#document-trees 'DOM Definition of Document tree' +[shadow tree]: https://dom.spec.whatwg.org/#shadow-trees 'DOM Definition of Shadow tree' +[required by wai-aria]: https://www.w3.org/TR/wai-aria-1.2/#requiredState 'WAI-ARIA Required States and Properties' +[id reference list]: https://www.w3.org/TR/wai-aria-1.2/#valuetype_idref_list 'WAI-ARIA definition of ID Reference List' +[id reference]: https://www.w3.org/TR/wai-aria-1.2/#valuetype_idref 'WAI-ARIA definition of ID Reference' From 1b4f97ef54a6024e6483c410ec323bc908d4ece3 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 6 Apr 2023 13:54:31 +0200 Subject: [PATCH 2/6] Address review comments Co-authored-by: Carlos Duarte --- _rules/aria-required-id-references-in6db8.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/_rules/aria-required-id-references-in6db8.md b/_rules/aria-required-id-references-in6db8.md index db65d1192f..70c16fd87c 100644 --- a/_rules/aria-required-id-references-in6db8.md +++ b/_rules/aria-required-id-references-in6db8.md @@ -32,7 +32,7 @@ This rule applies to any HTML element with an `aria-controls` attribute for whic ## Expectation -Each test target's [attribute value][] an space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [document][document tree] or [shadow tree][]. +Each test target's `aria-controls` [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [document][document tree] or [shadow tree][]. ## Assumptions @@ -176,12 +176,20 @@ The `combobox` does not have an `aria-expanded` [attribute value][] of `true`. #### Inapplicable Example 2 -The `aria-controls` attribute is not required on a `button`. +The `aria-controls` attribute is not required on a `button`. The reference is only required for `scrollbar` and for an expanded `combobox`. ```html ``` +#### Inapplicable Example 3 + +The `button` does not have an `aria-controls` attribute. + +```html + +``` + [semantic]: #semantic-role 'Definition of Semantic Role' [attribute value]: #attribute-value 'Definition of Attribute Value' [document tree]: https://dom.spec.whatwg.org/#document-trees 'DOM Definition of Document tree' From d7354391e060634fe506f4671cc5efde25cc175c Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 11 May 2023 14:45:38 +0200 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Jean-Yves Moyen --- _rules/aria-required-id-references-in6db8.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_rules/aria-required-id-references-in6db8.md b/_rules/aria-required-id-references-in6db8.md index 70c16fd87c..c4de2286b3 100644 --- a/_rules/aria-required-id-references-in6db8.md +++ b/_rules/aria-required-id-references-in6db8.md @@ -25,14 +25,14 @@ acknowledgments: ## Applicability -This rule applies to any HTML element with an `aria-controls` attribute for which one of the following is true: +This rule applies to any `aria-controls` attribute defined on an [HTML element][namespaced element] for which one of the following is true: - expanded combobox: the element is a [semantic][] `combobox` with an `aria-expanded` [attribute value][] of `true`; or - scrollbar: the element is a [semantic][] `scrollbar`. ## Expectation -Each test target's `aria-controls` [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [document][document tree] or [shadow tree][]. +Each test target's [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [document][document tree] or [shadow tree][]. ## Assumptions @@ -176,7 +176,7 @@ The `combobox` does not have an `aria-expanded` [attribute value][] of `true`. #### Inapplicable Example 2 -The `aria-controls` attribute is not required on a `button`. The reference is only required for `scrollbar` and for an expanded `combobox`. +This element with an `aria-controls` attribute is not a [semantic][] `scrollbar` nor `combobox`. ```html From 436bb56971758531cd8eee751608d24adfced375 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 15 Jun 2023 14:44:39 +0200 Subject: [PATCH 4/6] Apply suggestions from code review Co-authored-by: Tom Brunet Co-authored-by: Jean-Yves Moyen --- _rules/aria-required-id-references-in6db8.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_rules/aria-required-id-references-in6db8.md b/_rules/aria-required-id-references-in6db8.md index c4de2286b3..673f296613 100644 --- a/_rules/aria-required-id-references-in6db8.md +++ b/_rules/aria-required-id-references-in6db8.md @@ -32,7 +32,7 @@ This rule applies to any `aria-controls` attribute defined on an [HTML element][ ## Expectation -Each test target's [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [document][document tree] or [shadow tree][]. +Each test target's [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [shadow tree][] or, if not within a [shadow tree][], within the same [document][document tree] ## Assumptions @@ -44,7 +44,7 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w ## Background -This rule is written specifically for `aria-controls`, because it is the only [ID Reference List][] property that is [required by WAI-ARIA][]. The `aria-controls` property is only required by the `scrollbar` role, and by an expanded `combobox`. There are no [ID Reference][] properties that are required by WAI-ARIA for any role. +This rule is written specifically for `aria-controls`, because it is the only [ID Reference List][] property that is [required by WAI-ARIA][]. The `aria-controls` property is only required by the `scrollbar` role and by an expanded `combobox`. There are no [ID Reference][] properties that are required by WAI-ARIA for any role. ### Bibliography @@ -167,7 +167,7 @@ The `aria-controls` attribute of this expanded `combobox` references a `popup_li #### Inapplicable Example 1 -The `combobox` does not have an `aria-expanded` [attribute value][] of `true`. +The `aria-controls` attribute is defined on a `combobox` which does not have an `aria-expanded` [attribute value][] of `true`. ```html @@ -176,7 +176,7 @@ The `combobox` does not have an `aria-expanded` [attribute value][] of `true`. #### Inapplicable Example 2 -This element with an `aria-controls` attribute is not a [semantic][] `scrollbar` nor `combobox`. +This `aria-controls` attribute is not defined on a [semantic][] `scrollbar` nor `combobox`. ```html @@ -184,7 +184,7 @@ This element with an `aria-controls` attribute is not a [semantic][] `scrollbar` #### Inapplicable Example 3 -The `button` does not have an `aria-controls` attribute. +There is no `aria-controls` attribute. ```html From 63e78291dcbe4861895df3abb1b2e6f27da976cf Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 22 Jun 2023 17:08:37 +0200 Subject: [PATCH 5/6] Update _rules/aria-required-id-references-in6db8.md --- _rules/aria-required-id-references-in6db8.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/_rules/aria-required-id-references-in6db8.md b/_rules/aria-required-id-references-in6db8.md index 673f296613..7e52cfc3cb 100644 --- a/_rules/aria-required-id-references-in6db8.md +++ b/_rules/aria-required-id-references-in6db8.md @@ -142,7 +142,7 @@ The `aria-controls` attribute of this `scrollbar` references IDs of `content-1` The `aria-controls` attribute of this expanded `combobox` references a `popup_listbox` ID. This `id` exists, but in a different DOM tree as the `combobox`. ```html - +
- -