ampproject / ampproject/amphtml

♿ Make validator explicitly look for `lang` attribute on document and `alt` on images?

Open
#32,780 6 comments 0 reactions 2 assignees Claimed by @patrickkettner View on GitHub
Related to: Accessibility Stale Type: Feature Request
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## Describe the new feature or change to an existing feature you'd like to see

A large part of the relatively trivial accessibility issues found during the recent audits of AMP components and documentation was the general lack of `lang` attributes on the `` element and the lack of `alt` attributes on image elements (``. `amp-anim`, etc).

These are the sort of omissions that are flagged as warnings by the regular [W3C HTML validator](https://validator.w3.org/nu/).

Would it make sense to have the AMP validator to also look for these relatively straightforward things (noting that `alt` text - and `alt=""` empty attribute to explicitly denote purely presentational images - is in general required for [WCAG 2.1 SC 1.1.1](https://www.w3.org/TR/WCAG/#non-text-content), and use of `lang` for [WCAG 2.1 SC 3.1.1](https://www.w3.org/TR/WCAG/#language-of-page)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.