OAA IMAGES_2: Image file name is not valid alt text.
Details
For images that don’t have a presentation role, check to see if the alt text is a reference to a graphics file. An image file name may not be specified for valid alternative text.
Rulesets
- WCAG 2.0 Requirement 1.1.1 Non-text Content
- Status: Accepted
- Severity: Violation
- Priority: Priority 1
- IITAA 1.0 4.1 Provide appropriate "alternate text" for all images.
- Type:
- Severity: Violation
- Priority: Priority 1
- Status: Accepted
Markup References
Validation Code
Message
An image file name may not be specified for valid alternative text.
Dependencies
None
Context
img[@role != "presentation"]
Parameters
- alt_forebidden_file_ext_pattern : { type: Regular Expression , value: /.+\.(bmp|jpg|jpeg|jfif|gif|png|tif|tiff)$/i }
Code
function (ruleContext) {
var found = this.validateParams.alt_forebidden_file_ext_pattern.value.test(ruleContext.alt);
return new ValidationResult(!found, [ruleContext], 'alt', '', []);
}
>
var found = this.validateParams.alt_forebidden_file_ext_pattern.value.test(ruleContext.alt);
return new ValidationResult(!found, [ruleContext], 'alt', '', []);
}
>