OAA IMAGES_5: Longdesc must have valid URI.
Details
For images that don’t have a presentation role, make sure longdesc points to a legitimate alternative resource (e.g. an .html file).
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
The longdesc must point to a legitimate alternative resource (e.g. an .html file).
Dependencies
None
Context
img[@longdesc][@role != "presentation"]
Parameters
- valid_longdesc_url_pattern : { type: Regular Expression , value: /.+\.[x]?htm[l]?$/i }
Code
function (ruleContext) {
var passed = this.validateParams.valid_longdesc_url_pattern.value.test(ruleContext.longDesc);
return new ValidationResult(passed, [ruleContext], 'longdesc', '', []);
} // endfunction
>
var passed = this.validateParams.valid_longdesc_url_pattern.value.test(ruleContext.longDesc);
return new ValidationResult(passed, [ruleContext], 'longdesc', '', []);
} // endfunction
>