dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.91k stars 772 forks source link

Rule suggestion: detect SC 1.2.1 violations for video-only content without alternative/transcript/audio track #4596

Open AllThingsSmitty opened 3 days ago

AllThingsSmitty commented 3 days ago

Product

axe-core

Product Version

No response

Latest Version

Issue Description

Per the Google Chrome Lighthouse page, filing issue about a specific accessibility audit here.

Expectation

Running a Lighthouse scan of a page where a separate accessibility scan tool we pay for has flagged the page as failing to pass WCAG 2.2 SC 1.2.1: Audio-only and Video-only (Prerecorded).

The page contains a video being used as a background image banner, which copy and CTAs on top. When running Lighthouse we're expecting it to catch this issue and report the problem so it may be fixed during development.

Actual

Lighthouse reports a perfect score on the page in question. It does provide an audio and video summary of features it detected. However, it's not finding the WCAG 2.2 SC 1.2.1: Audio-only and Video-only (Prerecorded) issue.

How to Reproduce

Additional context

Any thing else we should know about the issue?

dbjorge commented 2 days ago

Thanks for the suggestion! We agree that it would be awesome if we could add a new axe-core rule that detected SC 1.2.1 violations in video-only <video> elements like this example.

The main reason that axe-core doesn't have such a rule today is that it is technically challenging to create such a rule without false positives (ie, to guarantee that if we say "this <video> element is a violation", that it really is an SC 1.2.1 violation). Part of axe-core's philosophy that sets it apart from other accessibility scanning tools is that we are very strict about avoiding false positives.

The reason it's difficult to avoid false positives in this specific case is that there are several techniques an author can use to pass SC 1.2.1, and some of them are difficult to detect automatically:

  1. The author can provide an "alternative for time-based media" (a transcript) for the video-only content. The SC is loose about what format this is allowed to take on. Particularly, it does not require that it be programmatically associated to the video; in fact, it is admissible for it to be an entirely separate document that is merely linked from the page with the video.
  2. The author can label the video as a "media alternative for text". Again, the SC does not require that this labelling be programmatically associated with the video; it might appear anywhere on the page.
  3. The author can provide an audio track the presents equivalent information.

axe-core could detect the absence of an audio track similarly to how the video-caption rule works, but it would be very difficult to determine automatically whether cases 1 or 2 might apply without false positives.

While I think this would be challenging to turn into an axe-core rule, I do think this could be a good candidate for something like an axe DevTools Pro Intelligent Guided Test.