Skip to content

Commit

Permalink
Merge branch 'develop' into wcag22-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers authored Jan 25, 2024
2 parents a734415 + c4a040d commit b8f36ea
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 138 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)
})
})
13 changes: 13 additions & 0 deletions _rules/css-restrict-orientation-b33eff.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ acknowledgments:
authors:
- Audrey Maniez
- Jey Nandakumar
- Tom Brunet
funding:
- WAI-Tools
---
Expand Down Expand Up @@ -160,6 +161,8 @@ A page where CSS [transform](https://www.w3.org/TR/css-transforms/#propdef-trans
@media (orientation: portrait) {
html {
transform: rotate(1.5708rad);
width: min(100vw, 100vh);
height: min(100vw, 100vh);
}
}
</style>
Expand Down Expand Up @@ -203,11 +206,16 @@ This page appears rotated at a slight angle of 2.5 degrees for stylistic purpose
<style>
body {
transform: rotate(2.5deg);
padding: 2rem;
width: min(100vw, 100vh);
height: min(100vw, 100vh);
}
@media (orientation: landscape) {
body {
transform: rotate(92.5deg);
position: absolute;
right: 0px;
}
}
</style>
Expand All @@ -230,6 +238,8 @@ A page where the CSS [rotate](https://www.w3.org/TR/css-transforms-2/#individual
@media (orientation: portrait) {
html {
rotate: 90deg;
width: min(100vw, 100vh);
height: min(100vw, 100vh);
}
}
</style>
Expand Down Expand Up @@ -315,6 +325,9 @@ A page where CSS [transform](https://www.w3.org/TR/css-transforms/#propdef-trans
<style>
body {
transform: rotate(90deg);
width: calc(min(100vw, 100vh) - 2rem);
height: calc(min(100vw, 100vh) - 2rem);
padding: 1rem;
}
</style>
</head>
Expand Down
3 changes: 1 addition & 2 deletions _rules/image-no-text-0va7u6.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ Each test target has no [visible][] [text][human language], except if at least o

## Assumptions

- There is no mechanism to change the rendered text in the image resource. Otherwise, the rule might fail while [SC 1.4.5 Images of Text][sc1.4.5] might be satisfied.
- The specific presentation of the text rendered in the image resource can be achieved through formatted text. Otherwise, the rule might fail while [SC 1.4.5 Images of Text][sc1.4.5] might be satisfied.
- This rule assumes that there is no mechanism to change the rendering of text within image resources on the page. For pages that *do* provide such a mechanism, this rule might fail even if [SC 1.4.5 Images of Text][sc1.4.5] is satisfied.
- When used in HTML, the SVG `<text>` element is not considered to be an image of text. This is because like any other element in HTML, SVG `<text>` can be adjusted through custom style sheets. This does not apply for SVG text that is in a separate file, and displayed through, for example, the `img` element.

## Accessibility Support
Expand Down
13 changes: 7 additions & 6 deletions _rules/role-required-states-and-properties-4e8ab6.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ input_aspects:
acknowledgments:
authors:
- Anne Thyme Nørregaard
- Tom Brunet
funding:
- WAI-Tools
---
Expand All @@ -38,21 +39,19 @@ For each test target, the [WAI-ARIA required states and properties][] for the ro

## Assumptions

- The applicability of this rule is limited to [explicit semantic roles][explicit semantic role] based on an assumption that all native HTML and SVG elements have native attributes that are mapped to all of the [WAI-ARIA required states and properties](https://www.w3.org/TR/wai-aria/#requiredState) for the [implicit semantic role][] of the element.

- The ARIA `role` is being used to comply to WCAG.
- The ARIA `role` is being used to conform to WCAG.

## Accessibility Support

This rule relies on browsers and assistive technologies to support leaving out [WAI-ARIA required states and properties][] when a [WAI-ARIA implicit value for role][] is specified in [WAI-ARIA Specifications](#wai-aria-specifications).
This rule relies on browsers and assistive technologies to support leaving out [WAI-ARIA required states and properties][] when a [WAI-ARIA implicit value for role][] is specified in [WAI-ARIA Specifications][].

**Note:** The required states and properties with implicit values can be found in the Core Accessibility API Mappings 1.1 [Overview of default values for missing required attributes](https://www.w3.org/TR/core-aam-1.1/#authorErrorDefaultValuesTable).

## Background

Omitting required ARIA properties is often the result of a developer error. When required properties are missing some browsers and assistive technologies will guess the property, or leave the element inaccessible.
Omitting [WAI-ARIA required states and properties][] is often the result of a developer error. When required properties are missing and a default value is not specified by [WAI-ARIA Specifications][], the behavior is not defined. For [WAI-ARIA 1.2][], the only [explicit semantic roles][explicit semantic role] with a required property with a default value are the `option` and `tabs roles` for the `aria-selected` property.

This rule is testing author built components, not user-agent built ones. Elements that keep their [implicit semantic role][] are mapped into conforming accessible objects, with all required properties, by user agents and are therefore not tested by this rule. Most of these mappings are defined in the [HTML Accessibility API Mappings, Attribute State and Property Mappings](https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings).
This rule is testing author built components that specify [explicit semantic roles][explicit semantic role] and not components that keep their [implicit semantic role][]. For components that keep their [implicit semantic role][], all native HTML and SVG elements have native attributes that are mapped to all of the [WAI-ARIA required states and properties](https://www.w3.org/TR/wai-aria/#requiredState). Most of these mappings are defined in the [HTML Accessibility API Mappings, Attribute State and Property Mappings][html aam].

### Bibliography

Expand Down Expand Up @@ -221,9 +220,11 @@ This `combobox` is not [included in the accessibility tree][] due to its styling
```

[explicit semantic role]: #explicit-role 'Definition of explicit semantic role'
[html aam]: https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings 'Specification of HTML attributes value mapping to ARIA states and properties'
[implicit semantic role]: #implicit-role 'Definition of implicit semantic role'
[included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of Included in The Accessibility Tree'
[wai-aria required states and properties]: https://www.w3.org/TR/wai-aria-1.2/#requiredState
[wai-aria specifications]: #wai-aria-specifications 'Definition of WAI-ARIA Specifications'
[wai-aria implicit value for role]: https://www.w3.org/TR/wai-aria-1.2/#implictValueForRole
[wai-aria 1.2]: https://www.w3.org/TR/wai-aria-1.2/
[html or svg element]: #namespaced-element
Expand Down
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/WCAG22/#dfn-non-text-content 'WCAG Definition of Non-text content'
[presentational roles conflict resolution]: https://www.w3.org/TR/wai-aria-1.2/#conflict_resolution_presentation_none 'Presentational Roles Conflict Resolution'
[semantic role]: #semantic-role 'Definition of Semantic role'
Expand Down
Loading

0 comments on commit b8f36ea

Please sign in to comment.