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

SC1-1-1-img-without-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 <img> elements provide an alt attribute.

Background

Assumptions

Open question: Is provision of an aria-label or aria-labelledby attribute sufficient and should be handled here?

"Please note that dropping the alt attribute and replacing it with aria-label is not a recommended practice. The alt attribute is still required for images and omitting it will result in a validation error. Ommitting the alt attribute will also cause severe problems for people still stuck with equipment and older browsers / screen readers that do not (sufficiently) support ARIA."

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)

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