Warning:
This wiki has been archived and is now read-only.
SC1-1-1-img-without-alt
From Automated WCAG Monitoring Community Group
Status
Contents
Description
This test checks that <img>
elements provide an alt
attribute.
Background
- H37: Using alt attributes on img elements
- F38: Failure of Success Criterion 1.1.1 due to not marking up decorative images in HTML in a way that allows assistive technology to ignore them
- F65: Failure of Success Criterion 1.1.1 due to omitting the alt attribute on img elements, area elements, and input elements of type "image"
Assumptions
Open question: Is provision of an
aria-label
or aria-labelledby
attribute sufficient and should be handled here?
Open question: F38:
For any img element that is used for purely decorative content:
For any img element that is used for purely decorative content:
Check whether the element has no role attribute or has a role attribute value that is not "presentation".
Check whether the element has no alt attribute or has an alt attribute with a value that is not null.
(Both must be true to fail)
In our understanding this implies the possibility of a missing alt
attribute, if "role=presentation" is set.
Test properties
Property | Possible values |
---|---|
Success Criterion | 1.1.1 Non-text Content |
Test mode | automatic |
Test environment | rendered page |
Test subject | web page state |
Test procedure
Selector
Test mode:
earl:automatic
//img[not(@alt)]
Step 1
Test mode:
earl:automatic
Check if the <img>
element has attribute role="presentation"
.
if yes, return
Property | Value |
---|---|
TestCase | SC111-img-without-alt |
Identifier | SC111-img-without-alt-pass1 |
Outcome | passed |
Pointer | position |
Info |
else return
Property | Value |
---|---|
TestCase | SC111-img-without-alt |
Identifier | SC111-img-without-alt-fail1 |
Outcome | failed |
ErrorMessage | missing alt attribute |
Pointer | position |
Info |