OAA WIDGET_10: Check that 'ARIA-' attributes are valid properties and states
Details
- Check to see that ARIA attributes are valid.
Rulesets
- WCAG 2.0 Requirement 4.1.2 Name, Role, Value
- Status: Accepted
- Severity: Violation
- Priority: Priority 1
- IITAA 1.0 13.1 Ensure that scripted functions are usable with assistive technologies.
- Type:
- Severity: Violation
- Priority: Priority 1
- Status: Accepted
Markup References
- ARIA 1.0: [aria-activedescendant]
- ARIA 1.0: [aria-autocomplete]
- ARIA 1.0: [aria-busy]
- ARIA 1.0: [aria-checked]
- ARIA 1.0: [aria-controls]
- ARIA 1.0: [aria-describedby]
- ARIA 1.0: [aria-disabled]
- ARIA 1.0: [aria-dropeffect]
- ARIA 1.0: [aria-expanded]
- ARIA 1.0: [aria-flowto]
- ARIA 1.0: [aria-grabbed]
- ARIA 1.0: [aria-haspopup]
- ARIA 1.0: [aria-hidden]
- ARIA 1.0: [aria-invalid]
- ARIA 1.0: [aria-label]
- ARIA 1.0: [aria-labelledby]
- ARIA 1.0: [aria-level]
- ARIA 1.0: [aria-live]
- ARIA 1.0: [aria-multiline]
- ARIA 1.0: [aria-multiselectable]
- ARIA 1.0: [aria-orientation]
- ARIA 1.0: [aria-owns]
- ARIA 1.0: [aria-posinset]
- ARIA 1.0: [aria-pressed]
- ARIA 1.0: [aria-readonly]
- ARIA 1.0: [aria-relevant]
- ARIA 1.0: [aria-required]
- ARIA 1.0: [aria-selected]
- ARIA 1.0: [aria-setsize]
- ARIA 1.0: [aria-sort]
- ARIA 1.0: [aria-valuemax]
- ARIA 1.0: [aria-valuemin]
- ARIA 1.0: [aria-valuenow]
- ARIA 1.0: [aria-valuetext]
Validation Code
Message
The attribute %1$S is not a recognized ARIA attribute.
Dependencies
None
Context
*
Parameters
None
Code
function (ruleContext) {
var attrNameArr = new Array();
// TY attributes is null when the node is a comment node
if (!!ruleContext.attributes && ruleContext.attributes.length) {
// for each aria attr check for nonexistant IDs
for(var i=0; i< ruleContext.attributes.length; i++ ) {
var attrName = ruleContext.attributes[i].name;
if (OpenAjax.a11y.util.isDefinedAriaAttribute(ruleContext, attrName)) {
var dataTypes = OpenAjax.a11y.aria.propertyDataTypes[attrName];
if (!dataTypes) attrNameArr.push(attrName);
}
}
var retMsg = new Array();
retMsg.push (attrNameArr.toString());
}
var passed = attrNameArr.length == 0;
return new ValidationResult(passed, [ruleContext], attrNameArr, '', retMsg);
}
>