Warning:
This wiki has been archived and is now read-only.
SC1-1-1-img-nonempty-alt
Status
Contents
Description
This test checks that the <alt>
attribute of <img>
elements provide sufficient descriptions.
Background
- H37: Using alt attributes on img elements
- F30: Failure of Success Criterion 1.1.1 and 1.2.1 due to using text alternatives that are not alternatives (e.g., filenames or placeholder text)
- 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
- F39: Failure of Success Criterion 1.1.1 due to providing a text alternative that is not null (e.g., alt="spacer" or alt="image") for images that should be ignored by assistive technology
Assumptions
F38: 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)
and
F39: Identify any img elements that are used for decoration, spacing or other purpose that is not part of the meaningful content in the page
Check that the alt attribute for these elements is null.
(Latter must be false to fail)
seem to be contradictory, because in F39 the alt
attribute must be null, but in F38 there could be any value if role=presentation
is set
Test properties
Property | Possible values |
---|---|
Success Criterion | 1.1.1 Non-text Content |
Test mode | SemiAuto |
Test environment | rendered page |
Test subject | web page state |
Test procedure
Selector
earl:automatic
//img[not(@alt="")]
Step 1
earl:automatic
Check if the alt
attribute value is a filename or an URL
if yes, return
Property | Value |
---|---|
TestCase | SC1-1-1-img-nonempty-alt |
Identifier | SC1-1-1-img-nonempty-alt-fail1 |
Outcome | failed |
ErrorMessage | ALT attribute value is a filename or URL |
Pointer | position |
Info |
else continue with #Step 2
Step 2
earl:automatic
Check if the alt
attribute value is non-empty, as defined (contain 2 or more characters that are not white space characters or punctionmarks).
if yes, return
Property | Value |
---|---|
TestCase | SC1-1-1-img-nonempty-alt |
Identifier | SC1-1-1-img-nonempty-alt-fail2 |
Outcome | failed |
ErrorMessage | ALT attribute value is not sufficiently descriptive. |
Pointer | position |
Info | ALT attribute value does not contain 2 or more characters that are not white space characters or punctionmarks. |
else continue with #Step 3
Step 3
earl:manual
Present the image with the corresponding text alternative to the user.
Question: Does the text sufficiently describe the image? Is there any textual information contained in the image and is this information also written in the text?
if yes, return
Property | Value |
---|---|
TestCase | img-nonempty-alt |
Identifier | img-nonempty-alt-pass1 |
Outcome | passed |
Pointer | position |
Info |
else return
Property | Value |
---|---|
TestCase | img-nonempty-alt |
Identifier | img-nonempty-alt –fail3 |
Outcome | failed |
ErrorMessage | Text alternative not sufficiently descriptive. |
Pointer | position |
Info |