14. Links
Accessibility Requirements
- WCAG SC 2.4.4 Link Purpose (In Context) – The purpose of each link can be determined from the link text alone or from the link text together with its programmatically determined link context, except where the purpose of the link would be ambiguous to users in general.
- WCAG2 SC 4.1.2 Name, Role, Value: For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.
Test Method Rationale
Links and buttons, including scripted elements, must have meaningful text (either directly associated or available in context) that describes their purpose or function. In order for associated text to be available to assistive technologies, the information must be determinable programmatically.
Limitations, Assumptions, Exceptions
- From Understanding SC 2.4.4: There may be situations where the purpose of the link is supposed to be unknown or obscured. For instance, a game may have links identified only as door #1, door #2, and door #3. This link text would be sufficient because the purpose of the links is to create suspense for all users.
- programmatically determined link context is additional information that can be programmatically determined from relationships with a link, combined with the link text, and presented to users in different modalities
- Example: In HTML, information that is programmatically determinable from a link in English includes text that is in the same paragraph, list, or table cell as the link or in a table header cell that is associated with the table cell that contains the link.
- The combination of an element’s accessible name and accessible description is its text alternative.
14.A Test Procedure for Link Purpose (In Context)
Baseline Test ID: 14.A-LinkPurpose
Identify Content
All links including those that are scripted elements and assigned a role of a link.
Test Instructions
- Check that the combination of accessible name and accessible description is not empty. [SC 4.1.2]
- Check that the purpose of each link can be determined from the link and programmatically determined linked context [SC 2.4.4]:
- the link text,
- the link's accessible name and accessible description,
- text that is in the same paragraph, list, or table cell as the link,
- the table header cell that is associated with the table cell that contains the link.
Test Results
If any of the above checks fail, then Baseline Test 14.A-LinkPurpose fails.
Advisory: Tips for streamlined test processes
- In cases where the link is to a document or a web application, the name of the document or web application would be sufficient to describe the purpose of the link (which is to take the user to the document or web application).
WCAG 2.2 Techniques
The following sufficient techniques and/or common failures were considered when developing this test procedure for this baseline requirement:
- ARIA7: Using aria-labelledby for link purpose
- ARIA8: Using aria-label for link purpose
- F89: Failure of Success Criteria 2.4.4, 2.4.9 and 4.1.2 due to not providing an accessible name for an image which is the only content in a link
- G53: Identifying the purpose of a link using link text combined with the text of the enclosing sentence
- G91: Providing link text that describes the purpose of a link
- H77: Identifying the purpose of a link using link text combined with its enclosing list item
- H79: Identifying the purpose of a link in a data table using the link text combined with its enclosing table cell and associated table header cells