OAA WIDGET_9: Role value must be valid
Details
- Check to see that the role is 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: [role="alert"]
- ARIA 1.0: [role="alertdialog"]
- ARIA 1.0: [role="application"]
- ARIA 1.0: [role="article"]
- ARIA 1.0: [role="banner"]
- ARIA 1.0: [role="button"]
- ARIA 1.0: [role="checkbox"]
- ARIA 1.0: [role="columnheader"]
- ARIA 1.0: [role="combobox"]
- ARIA 1.0: [role="complementary"]
- ARIA 1.0: [role="contentinfo"]
- ARIA 1.0: [role="definition"]
- ARIA 1.0: [role="dialog"]
- ARIA 1.0: [role="directory"]
- ARIA 1.0: [role="document"]
- ARIA 1.0: [role="form"]
- ARIA 1.0: [role="grid"]
- ARIA 1.0: [role="gridcell"]
- ARIA 1.0: [role="group"]
- ARIA 1.0: [role="heading"]
- ARIA 1.0: [role="img"]
- ARIA 1.0: [role="link"]
- ARIA 1.0: [role="list"]
- ARIA 1.0: [role="listbox"]
- ARIA 1.0: [role="listitem"]
- ARIA 1.0: [role="log"]
- ARIA 1.0: [role="main"]
- ARIA 1.0: [role="marquee"]
- ARIA 1.0: [role="math"]
- ARIA 1.0: [role="menu"]
- ARIA 1.0: [role="menubar"]
- ARIA 1.0: [role="menuitem"]
- ARIA 1.0: [role="menuitemcheckbox"]
- ARIA 1.0: [role="menuitemradio"]
- ARIA 1.0: [role="navigation"]
- ARIA 1.0: [role="note"]
- ARIA 1.0: [role="option"]
- ARIA 1.0: [role="presentation"]
- ARIA 1.0: [role="progressbar"]
- ARIA 1.0: [role="radiogroup"]
- ARIA 1.0: [role="region"]
- ARIA 1.0: [role="row"]
- ARIA 1.0: [role="rowgroup"]
- ARIA 1.0: [role="rowheader"]
- ARIA 1.0: [role="scrollbar"]
- ARIA 1.0: [role="search"]
- ARIA 1.0: [role="separator"]
- ARIA 1.0: [role="slider"]
- ARIA 1.0: [role="spinbutton"]
- ARIA 1.0: [role="status"]
- ARIA 1.0: [role="tab"]
- ARIA 1.0: [role="tablist"]
- ARIA 1.0: [role="tabpanel"]
- ARIA 1.0: [role="textbox"]
- ARIA 1.0: [role="timer"]
- ARIA 1.0: [role="toolbar"]
- ARIA 1.0: [role="tooltip"]
- ARIA 1.0: [role="tree"]
- ARIA 1.0: [role="treegrid"]
- ARIA 1.0: [role="treeitem"]
Validation Code
Message
The value %1$S is not a valid role.
Dependencies
None
Context
*[@role]
Parameters
None
Code
function (ruleContext) {
var passed = true;
var role = ruleContext.getAttribute("role");
// - a role value of null indicates no role attribute is present in (FF,Opera, Safari, Chrome).
// - '' value indicates the role is set to an empty string for all browsers except
// IE which also returns '' if no role attribute is present
// neither of these values allow for unsupported state to be tested
// Make sure the role value is consistent with IE as you don't want to push a null on the stack
if (role==null)
role='';
// Check to see that the role is valid
if (!OpenAjax.a11y.aria.designPatterns[role]) passed = false;
return new ValidationResult(passed, [ruleContext], 'role', '', [role]);
}
>