Nazwa, rola, wartość
Objaśnienie
KS
4.1.2
Intent of Name, Role, Value
The intent of this Success Criterion is to ensure that Assistive Technologies (AT) can gather information about, activate (or set) and keep up to date on the status of user interface controls in the content.
When standard controls from accessible technologies are used, this process is straightforward. If the user interface elements are used according to specification the conditions of this provision will be met. (See examples of Success Criterion 4.1.2 below)
If custom controls are created, however, or interface elements are programmed (in code or script) to have a different role and/or function than usual, then additional measures need to be taken to ensure that the controls provide important information to assistive technologies and allow themselves to be controlled by assistive technologies.
A particularly important state of a user interface control is whether or not it has focus. The focus state of a control can be programmatically determined, and notifications about change of focus are sent to user agents and assistive technology. Other examples of user interface control state are whether or not a checkbox or radio button has been selected, or whether or not a collapsible tree or list node is expanded or collapsed.
Success Criterion 4.1.2 requires a programmatically determinable name for all user interface components. Names may be visible or invisible. Occasionally, the name must be visible, in which case it is identified as a label. Refer to the definition of name and label in the glossary for more information.
Benefits of Name, Role, Value
- Providing role, state, and value information on all user interface components enables compatibility with assistive technology, such as screen readers, screen magnifiers, and speech recognition software, used by people with disabilities.
Examples of Name, Role, Value
-
Accessible APIs
A Java applet uses the accessibility API defined by the language.
Resources for Name, Role, Value
Techniques for Name, Role, Value
Sufficient Techniques for Name, Role, Value
Situation A: If using a standard user interface component in a markup language (e.g., HTML):
-
Using markup features to expose the name and role, allow user-settable properties to be directly set, and provide notification of changes using technology-specific techniques below:
Situation B: If using script or code to re-purpose a standard user interface component in a markup language:
Situation C: If using a standard user interface component in a programming technology:
-
Using the accessibility API features of a technology to expose the names and roles, allow user-settable properties to be directly set, and provide notification of changes using technology-specific techniques below:
Situation D: If creating your own user interface component in a programming language:
Additional Techniques (Advisory) for Name, Role, Value
Failures for Name, Role, Value
- Failure due to using script to make div or span a user interface control in HTML
- Failure due to implementing custom controls that do not use an accessibility API
- Failure due to not updating text alternatives when changes to non-text content occur
- Failure of 1.3.1 and 4.1.2 due to the association of label and user interface controls not being programmatically determinable
- Failure of Success Criterion 4.1.2 due to the focus state of a user interface component not being programmatically determinable or no notification of change of focus state available
- Failure of Success Criterion 4.1.2 due to not providing names for each part of a multi-part form field, such as a US telephone number
- Failure of 2.4.4 due to using null alt on an image where the image is the only content in a link