OAA STYLE_2: Color contrast ratio must be > 3 for large text
Rulesets
- WCAG 2.0 Requirement 1.4.3 Contrast (Minimum)
- Status: Accepted
- Severity: Violation
- Priority: Priority 1
- IITAA 1.0 10.1 Provide labels or titles for all form fields.
- Type:
- Severity: Violation
- Priority: Priority 1
- Status: Accepted
Markup References
Validation Code
Message
Foreground background color contrast ratio must be > 3 for large text
Dependencies
None
Context
#text
Parameters
None
Code
function (ruleContext) {
var node = ruleContext.parentNode;
if (node.ownerDocument.defaultView.getComputedStyle) {
var contrastObj = OpenAjax.a11y.colorUtil.createContrastElement(node);
var passed = contrastObj.luminosity > 3; return new ValidationResult(passed, [node], '', '', [contrastObj.hexFGColor, contrastObj.hexBGColor, contrastObj.luminosity]);
} else {
//getComputedStyle does not exist return new ValidationResult(-1, [node], '', '', []);
} // endif
} // endfunction
>
var node = ruleContext.parentNode;
if (node.ownerDocument.defaultView.getComputedStyle) {
var contrastObj = OpenAjax.a11y.colorUtil.createContrastElement(node);
var passed = contrastObj.luminosity > 3; return new ValidationResult(passed, [node], '', '', [contrastObj.hexFGColor, contrastObj.hexBGColor, contrastObj.luminosity]);
} else {
//getComputedStyle does not exist return new ValidationResult(-1, [node], '', '', []);
} // endif
} // endfunction
>