5. User Controls
Accessibility Requirements
- WCAG2 SC 4.1.2 Name, Role, Value: For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.
Test Method Rationale
The purpose of this Baseline test is to check the following accessibility properties of user controls:
- Name
- Role (test not yet available)
- State
- Value
Limitations, Assumptions, or Exceptions
- User interface component (as defined by WCAG) is a part of the content that is perceived by users as a single control for a distinct function. User interface components include form elements and links as well as components generated by scripts. This test uses the term “user controls” for brevity.
- The accessibility properties of the user control must be correct if the user control changes.
5.1 Test Procedure for Control Name
Baseline Test ID: 5.1-ChangedControlName
Identify Content
Identify user controls for a distinct function. Exclude forms and links as these are covered by [Baseline 10. Forms](../10Forms), [Baseline 14. Links](../14Links), respectively.
Test Instructions
- Check that the combination of the accessible name and accessible description is not empty. [SC 4.1.2]
- Check that the non-empty combination of the accessible name and accessible description describes the control's purpose. [SC 4.1.2] For details on the computation of the accessible name and accessible description, references include:
- If the name of the user control changes with use of the application, repeat the previous test steps and check that the accessible name is correct after the change.
- Depending on the control, a change of name may be triggered by various actions, such as changing values or states of other components, toggling a function, entering data in the component, mouseover, etc.
- Examples include entering a response in a form field for country changes the next form field's label from "state" to "province", selecting a control toggles its functionality from sorting ascending to descending, a link appends "Updated" to its name when the linked page is edited.
Test Results
If any of the above checks fail, then Baseline Test 5.1-ControlName fails.
5.2 Test Procedure for Control Role (not available)
5.3 Test Procedure for Control State
Baseline Test ID: 5.2-ControlState
Identify Content
Identify user controls for a distinct function. Examples include changes to forms, links, and toggle controls.
Test Instructions
- Check that the state of the user control is correct. Attributes such as
hidden
,disabled
, and the use of ARIA to control component states must be used correctly.[SC 4.1.2] - If the state of the user control changes with use of the application, check that the state of the user control is correct after a change of state. [SC 4.1.2]
- Depending on the control, a change of state may be triggered by various actions, such as changing values or states of other components, toggling a function, entering data in the component, mouseover, etc.
- Examples include a disabled "Submit" button is enabled when all required form fields are filled in, a link becomes visible after a user-initiated calculation completes, a check box changes from checked to unchecked, links that are hovered or visited.
Test Results
If any of the above checks fail, then Baseline Test 5.2-ControlState fails.
5.3 Test Procedure for Control Value
Baseline Test ID: 5.3-ControlValue
Identify Content
Identify controls that have a value that can be changed by a user. Examples include form fields and sliders.
Test Instructions
- Check that the value of the user control is correct. [SC 4.1.2]
- Modify the value of the user control. Depending on the control, a change of value may be performed by entering a number, selecting from a list of options, etc.
- Check that the value of the user control is correct after a change of value. [SC 4.1.2]
Test Results
If any of the above checks fail, then Baseline Test 5.3-ControlValue fails.
Advisory: Tips for streamlined test processes
- Changes to controls may also include changes in color to convey information. If so, this test should check that the information is programmatically determinable. If color is used as the only visual means of conveying information (or changes in information), then the content would fail to meet SC 1.4.1 Use of Color (addressed in Baseline 7. Sensory Characteristics).
- The accessible name and accessible description of some user controls are tested in other Baseline tests, such as Baseline 10. Forms, Baseline 14. Links. For user controls that have dedicated Baseline Tests, please map to those tests for accessible name instead of 5.1-ControlName.
- This test may require interaction with controls to assess changes in name, role, state, value. Interaction instructions such as a test plan may be helpful.