Skip to content

Commit

Permalink
Merge branch 'develop' into target-size-enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
Jym77 authored Jan 25, 2024
2 parents b4fe1de + c4a040d commit b65434a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
12 changes: 12 additions & 0 deletions _rules/__tests__/unique-ids.js
Original file line number Diff line number Diff line change
@@ -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)
})
})
23 changes: 20 additions & 3 deletions _rules/visible-label-in-accessible-name-2ee8b8.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
<button aria-label="close">X</button>
<button aria-label="anything">X</button>
```

#### Passed Example 6
Expand Down Expand Up @@ -143,6 +143,22 @@ This link has [visible][] text with mathematical symbols, that does not match th
<a href="/" aria-label="Proof of two multiplied by two is four">Proof of 2&times;2=4</a>
```

#### Failed Example 4

This link has [visible][] text does not match the [accessible name][] because there is a hyphen in the accessible name.

```html
<a href="#" aria-label="non-standard">nonstandard</a>
```

#### Failed Example 5

This link has [visible][] text does not match the [accessible name][] because there are extra spaces in the accessible name.

```html
<a aria-label="1 2 3. 4 5 6. 7 8 9 0" href="tel:1234567890">123.456.7890</a>
```

### Inapplicable

#### Inapplicable Example 1
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 3 additions & 1 deletion pages/glossary/matching-characters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit b65434a

Please sign in to comment.