Warning:
This wiki has been archived and is now read-only.

SC1-1-1-img-nonempty-alt

From Automated WCAG Monitoring Community Group
Jump to: navigation, search

Status

Version 0: For review

Version 0.1: For review


Description

This test checks that the <alt> attribute of <img> elements provide sufficient descriptions.

Background

Assumptions

Open question:
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

Test mode: earl:automatic


//img[not(@alt="")]

Step 1

Test mode: 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

Test mode: 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

Test mode: 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