ACT Rules for WCAG 2.0

ACT-R2: Proper use of aria-describedby

Important Information for reviewing ACT Rules

Important: The ACT Rules on this page are a demonstration of how they might be published by the W3C. The goal of this page is to add concrete examples for the Accessibility Conformance Testing Rules Format (DRAFT). Neither the ACT Rules, or the way they are presented here has been approved by the Accessibility Guidelines Working Group. If you have feedback, please comment by filing GitHub issues in the WCAG ACT repository, if this is not feasible, by email to public-wcag-act-comments@w3.org.

Accessibility Requirements

This conformance rule relates to:

Description

This rule checks the sufficient provision of a long text description for images that are using the aria-describedby attribute.

Elements are not checked for references to long text descriptions within short text alternatives such as “The image is described in text below”.

Background

This rule maps to WCAG 2.0 success criterion 1.1.1 and checks the following techniques and failures:

Assumptions

Test Subject Type

The following test subject types are used in this rule:

Test Procedure

Selector

Select all elements that match the following CSS selector:

img[aria-describedby],
input[type="image"][aria-describedby],
[role="img"][aria-describedby]

Exclude any elements that are not visible to screen-readers.

For each selected element, go through the following steps:

Test Case

Step 1

Check if at least one of the aria-describedby attribute values are valid identifiers.

If yes, continue with step 2.

Else, return step1-fail.

Step 2

Check if at least one of the elements referenced by valid aria-describedby attribute values exists.

If yes, continue with step 3.

Else, return step2-fail.

Step 3

Check if T2 provides an extended description of the image complementary to T1.

User Input Question:

Property Value
highlight Element with T1 and element with T2
question Does T2 provide an extended description of the image complementary to T1?
help If the image contributes meaning to the page or provide any functionality or conveys information additional to the text of the page, this must be described.
repair If no, could you suggest a long text alternative, which would sufficiently describe the image?
user_profile Requires sight
context yes

If yes, return step3-pass.

Else return step3-fail.

Outcomes

The resulting assertion is as follows,

Property Value
type Assertion
test act:ACT-R2
subject the selected element
mode earl:semi-automatic
result « One TestResult from below »

step1-fail

Property Value
type TestResult
outcome Failed
description None of the aria-describedby attribute values are valid identifiers.

step2-fail

Property Value
type TestResult
outcome Failed
description None of the elements referenced by aria-describedby exist.

step3-pass

Property Value
type TestResult
outcome Passed
description The long description provided using aria-describedby is sufficiently descriptive.

step3-fail

Property Value
type TestResult
outcome Failed
description The long description provided using aria-describedby is not sufficiently descriptive.

Changelog

This is the first version of this rule.

Validation Tests

To validate the implementation of this rule, all test cases for ACT-R2 must be passed.