From bb7e4c537301c54d4eb82abd19f9cbfd758506a5 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Wed, 10 Jan 2024 09:22:17 +0100 Subject: [PATCH 1/3] [chore] Add test to detect duplicate rule id (#2141) * Add test to detect duplicate rule id * Simplify duplicate testing --- _rules/__tests__/unique-ids.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 _rules/__tests__/unique-ids.js diff --git a/_rules/__tests__/unique-ids.js b/_rules/__tests__/unique-ids.js new file mode 100644 index 0000000000..587bbcd4ca --- /dev/null +++ b/_rules/__tests__/unique-ids.js @@ -0,0 +1,12 @@ +const getMarkdownData = require('../../utils/get-markdown-data') +const rulesData = getMarkdownData(`./_rules`) + +describe('Rule ids verification', () => { + const duplicates = rulesData.filter( + (ruleData, idx) => rulesData.findIndex(r => r.frontmatter.id === ruleData.frontmatter.id) !== idx + ) + + test('Rule ids are unique', () => { + expect(duplicates.length, `Duplicated rules: ${duplicates.map(ruleData => ruleData.filename).join(', ')}`).toBe(0) + }) +}) From 1db4aafdb5161ca0172d6d1b43fc494ec9e53ae5 Mon Sep 17 00:00:00 2001 From: Kathy Eng Date: Thu, 11 Jan 2024 10:10:23 -0500 Subject: [PATCH 2/3] Update visible-label-in-accessible-name-2ee8b8.md (#2101) * Update visible-label-in-accessible-name-2ee8b8.md * Update visible-label-in-accessible-name-2ee8b8.md * Update visible-label-in-accessible-name-2ee8b8.md * Update _rules/visible-label-in-accessible-name-2ee8b8.md * Update _rules/visible-label-in-accessible-name-2ee8b8.md * Update _rules/visible-label-in-accessible-name-2ee8b8.md * Update visible-label-in-accessible-name-2ee8b8.md add matching characters from act rules glossary * Update _rules/visible-label-in-accessible-name-2ee8b8.md --------- Co-authored-by: Jean-Yves Moyen --- ...visible-label-in-accessible-name-2ee8b8.md | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/_rules/visible-label-in-accessible-name-2ee8b8.md b/_rules/visible-label-in-accessible-name-2ee8b8.md index c17073622e..0b5d195890 100755 --- a/_rules/visible-label-in-accessible-name-2ee8b8.md +++ b/_rules/visible-label-in-accessible-name-2ee8b8.md @@ -38,7 +38,7 @@ This rule applies to any element for which all the following is true: ## Expectation -For each target element, all [text nodes][] in the [visible text content][] either match or are contained within the [accessible name][] of this target element, except for characters in the [text nodes][] used to express [non-text content][]. Leading and trailing [whitespace][] and difference in case sensitivity should be ignored. +For each target element, all [text nodes][] in the [visible text content][] [match characters][] and are contained within the [accessible name][] of this target element, except for characters in the [text nodes][] used to express [non-text content][]. Leading and trailing [whitespace][] and difference in case sensitivity should be ignored. ## Assumptions @@ -97,10 +97,10 @@ This button has [visible][] text that is contained within the [accessible name][ #### Passed Example 5 -This button has [visible][] text that does not need to be contained within the [accessible name][], because the "x" text node is [non-text content][]. +This button has [visible][] text that does not need to be contained within the [accessible name][], because the "x" text node is [non-text content][]. Note: this would need to meet SC 1.1.1 Non text content. ```html - + ``` #### Passed Example 6 @@ -143,6 +143,22 @@ This link has [visible][] text with mathematical symbols, that does not match th Proof of 2×2=4 ``` +#### Failed Example 4 + +This link has [visible][] text does not match the [accessible name][] because there is a hyphen in the accessible name. + +```html +nonstandard +``` + +#### Failed Example 5 + +This link has [visible][] text does not match the [accessible name][] because there are extra spaces in the accessible name. + +```html +123.456.7890 +``` + ### Inapplicable #### Inapplicable Example 1 @@ -181,6 +197,7 @@ This link has no [visible text content][]. ``` [accessible name]: #accessible-name 'Definition of accessible name' +[match characters]: #matching-characters 'Definition of matching characters' [non-text content]: https://www.w3.org/TR/WCAG21/#dfn-non-text-content 'WCAG Definition of Non-text content' [presentational roles conflict resolution]: https://www.w3.org/TR/wai-aria-1.1/#conflict_resolution_presentation_none 'Presentational Roles Conflict Resolution' [semantic role]: #semantic-role 'Definition of Semantic role' From c4a040d22519507a519ec555314370b8bb8abc91 Mon Sep 17 00:00:00 2001 From: Kathy Eng Date: Fri, 12 Jan 2024 10:34:21 -0500 Subject: [PATCH 3/3] Update matching-characters.md (#2144) * Update matching-characters.md * Update pages/glossary/matching-characters.md Co-authored-by: Jean-Yves Moyen --------- Co-authored-by: Jean-Yves Moyen --- pages/glossary/matching-characters.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/glossary/matching-characters.md b/pages/glossary/matching-characters.md index 936d228b0a..4628f99d39 100755 --- a/pages/glossary/matching-characters.md +++ b/pages/glossary/matching-characters.md @@ -5,4 +5,6 @@ unambiguous: true objective: true --- -A sequence of characters is considered to _match_ another if, after removing leading and trailing [space characters](https://html.spec.whatwg.org/#white_space) and replacing remaining occurrences of one or more space characters with a single space, the two sequences of characters are equal character-by-character, ignoring any differences in letter casing. +A sequence of characters is considered to _match_ another if, after removing leading and trailing [whitespace characters][] and replacing remaining occurrences of one or more whitespace characters with a single space, the two sequences of characters are equal character-by-character, ignoring any differences in letter casing. + +[whitespace characters]: #whitespace 'Definition of Whitespace'