Skip to content

New manual rule: Correct captions #2301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions _rules/video-captions-correct-a3b9xz.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
id: a3b9xz
name: Video element auditory content has correct captions
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that provided captions are correct for audio information in non-streaming `video` elements.
accessibility_requirements:
wcag20:1.2.2: # Captions (Prerecorded) (A)
forConformance: true
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed
wcag20:1.2.4: # Captions (Live) (AA)
forConformance: true
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed
Comment on lines +14 to +18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The applicability ignores non-streaming videos. I think that's the right call here, the same video cannot fail both criteria, so you'll need to remove 1.2.4 from this.

Suggested change
wcag20:1.2.4: # Captions (Live) (AA)
forConformance: true
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed

wcag-technique:F8: # Failure of Success Criterion 1.2.2 due to captions omitting some dialogue or important sound effects
forConformance: false
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed
wcag-technique:F75: # Failure of Success Criterion 1.2.2 by providing synchronized media without captions when the synchronized media presents more information than is presented on the page
forConformance: false
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed
input_aspects:
- DOM Tree
- CSS Styling
- Audio output
- Visual output
acknowledgments:
authors:
- Kathy Eng
funding:
- WAI-Tools
assets:
- Web Accessibility Perspective videos by W3C WAI.
---

## Applicability

This rule applies to [captions](https://www.w3.org/TR/WCAG22/#dfn-captions) provided for a [non-streaming](#non-streaming-media-element) `video` element that is [visible][] where the video contains [audio](#audio-output).

## Expectation

For each test target, speech and non-speech audio information that is not conveyed visually in the video is available in the [captions](https://www.w3.org/TR/WCAG22/#dfn-captions).

**Note:** Captions can be either embedded in the video file itself or can be made available through a separate track.

## Background

### Assumptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're making the assumption that a video with captions doesn't isn't also a media alternative. I think a video could in theory have incorrect captions, but still pass 1.2.2 if it's a media alternative. That's pretty theoretical though so I think an assumption about that is fine.


This rule assumes that the video element is used to play a video (for example, not only used to display an image), and that there is a mechanism to start the video.

### Accessibility Support

There are no accessibility support issues known.

### Related Rules

- [Video element auditory content has captions](https://www.w3.org/WAI/standards-guidelines/act/rules/f51b46/proposed/)
- [Video element auditory content has accessible alternative](https://www.w3.org/WAI/standards-guidelines/act/rules/eac66b/proposed/)

### Bibliography

- [Understanding Success Criterion 1.2.2: Captions (Prerecorded)](https://www.w3.org/WAI/WCAG22/Understanding/captions-prerecorded)
- [F8: Failure of Success Criterion 1.2.2 due to captions omitting some dialogue or important sound effects](https://www.w3.org/WAI/WCAG22/Techniques/failures/F8)
- [F75: Failure of Success Criterion 1.2.2 by providing synchronized media without captions when the synchronized media presents more information than is presented on the page](https://www.w3.org/WAI/WCAG22/Techniques/failures/F75)

## Test Cases

### Passed

#### Passed Example 1

The open captions contain all of the audio content.

```html
<video src="/test-assets/perspective-video/perspective-video-with-captions.mp4" controls></video>
```

#### Passed Example 2

The closed captions contain all of the audio content.

```html
<video src="/test-assets/perspective-video/perspective-video.mp4" controls>
<track src="/test-assets/perspective-video/perspective-caption.vtt" kind="captions" />
</video>
```

### Failed

#### Failed Example 1

A video element with an associated track element that contains incorrect captions. Specifically, the captions flip the role of the mouse and computer by saying, "Not being able to use your mouse because your computer doesn't work is frustrating."

```html
<video src="/test-assets/perspective-video/perspective-video.mp4" controls>
<track src="/test-assets/perspective-video/perspective-incorrect-caption.vtt" kind="captions" />
</video>
```

### Inapplicable

#### Inapplicable Example 1

A video element without audio.

```html
<video src="/test-assets/perspective-video/perspective-video-silent.mp4" controls></video>
```

#### Inapplicable Example 2

A video element that is not [visible][].

```html
<video src="/test-assets/perspective-video/perspective-video.mp4" controls style="display: none;"></video>
```

#### Inapplicable Example 3

A video element without any form of captions.

```html
<video src="/test-assets/perspective-video/perspective-video.mp4" controls></video>
```

#### Inapplicable Example 4

A video element with text on the same page that describes the audio in the video.

```html
<p>
The video below shows a man working on a keyboard. A voiceover is heard saying the following text: Web accessibility
perspectives. Keyboard compatibility. Not being able to use your computer because your mouse doesn't work, is
frustrating. Many people use only the keyboard to navigate websites. Either through preference or circumstance.
</p>
<video src="/test-assets/perspective-video/perspective-video.mp4" controls></video>
```

#### Inapplicable Example 5

A video element with an explicitly associated text on the same page that describes the audio in the video.

```html
<p id="text">
The video below shows a man working on a keyboard. A voiceover is heard saying the following text: Web accessibility
perspectives. Keyboard compatibility. Not being able to use your computer because your mouse doesn't work, is
frustrating. Many people use only the keyboard to navigate websites. Either through preference or circumstance.
</p>
<video src="/test-assets/perspective-video/perspective-video.mp4" controls ariadescribedby="text"></video>
```

[visible]: #visible 'Definition of visible'
36 changes: 20 additions & 16 deletions _rules/video-captions-f51b46.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This rule applies to every [non-streaming](#non-streaming-media-element) `video`

## Expectation

For each test target, audio information that is not conveyed visually in the video, is available through [captions](https://www.w3.org/TR/WCAG22/#dfn-captions).
For each test target, [captions](https://www.w3.org/TR/WCAG22/#dfn-captions) are provided.

**Note:** Captions can be either embedded in the video file itself or can be made available trough a separate track.

Expand All @@ -58,6 +58,10 @@ This rule assumes that the video element is used to play a video (for example, n

There are no accessibility support issues known.

### Related Rules

This rule does not evaluate the captions for accuracy or quality. See [Video element auditory content has correct captions](https://www.w3.org/WAI/standards-guidelines/act/rules/a3b9xz/).

### Bibliography

- [Understanding Success Criterion 1.2.2: Captions (Prerecorded)](https://www.w3.org/WAI/WCAG22/Understanding/captions-prerecorded)
Expand All @@ -79,14 +83,24 @@ A video element that has open captions for all of the audio content.

#### Passed Example 2

A video element with an associated track element that contains captions for all of the audio content.
A video element has closed captions.

```html
<video src="/test-assets/perspective-video/perspective-video.mp4" controls>
<track src="/test-assets/perspective-video/perspective-caption.vtt" kind="captions" />
</video>
```

#### Passed Example 3

A video element with an associated track element that contains incorrect captions. This rule does not evaluate the captions for accuracy or quality.

```html
<video src="/test-assets/perspective-video/perspective-video.mp4" controls>
<track src="/test-assets/perspective-video/perspective-incorrect-caption.vtt" kind="captions" />
</video>
```

### Failed

#### Failed Example 1
Expand All @@ -99,17 +113,7 @@ A video element without any form of captions.

#### Failed Example 2

A video element with an associated track element that contains incorrect captions. Specifically, the captions flip the role of the mouse and computer by saying, "Not being able to use your mouse because your computer doesn't work is frustrating."

```html
<video src="/test-assets/perspective-video/perspective-video.mp4" controls>
<track src="/test-assets/perspective-video/perspective-incorrect-caption.vtt" kind="captions" />
</video>
```

#### Failed Example 3

A video element with text on the same page that describes the audio in the video.
A video element with text on the same page that describes the audio in the video, but the video itself has no captions.

```html
<p>
Expand All @@ -120,17 +124,17 @@ A video element with text on the same page that describes the audio in the video
<video src="/test-assets/perspective-video/perspective-video.mp4" controls></video>
```

#### Failed Example 4
#### Failed Example 3

A video element with an explicitly associated text on the same page that describes the audio in the video.
A video element with an explicitly associated text on the same page that describes the audio in the video, but the video itself has no captions.

```html
<p id="text">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 137 there is a problem that this PR didn't create, but I noticed it while reviewing: it says ariadescribedby="text". That's missing a hyphen. It should be: aria-describedby="text"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected. Thanks!

The video below shows a man working on a keyboard. A voiceover is heard saying the following text: Web accessibility
perspectives. Keyboard compatibility. Not being able to use your computer because your mouse doesn't work, is
frustrating. Many people use only the keyboard to navigate websites. Either through preference or circumstance.
</p>
<video src="/test-assets/perspective-video/perspective-video.mp4" controls ariadescribedby="text"></video>
<video src="/test-assets/perspective-video/perspective-video.mp4" controls aria-describedby="text"></video>
```

### Inapplicable
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
{
"name": "Helen Burge",
"url": "https://github.com/HelenBurge"
},
{
"name": "Kathy Eng",
"url": "https://github.com/kengdoj"
}
],
"devDependencies": {
Expand Down