-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessibility primitives: computedRole and computedLabel #1439
Comments
For example |
An example that cannot be determined in JavaScript:
Both roles are valid in ARIA 1.0 (checkbox) and ARIA 1.1 (switch) so there is no way from the content side to determine whether the engine supports the newer switch role, or whether it falls back to the 1.0 role. |
Currently it would be very challenging and possibly undesirable (implementation-wise) to expose these outside the testing context. There is a long-term roadmap in AOM for standardizing the Accessibility tree, but that is out of scope for the near future. |
@AutomatedTester Requested I fill in a bit more info about what these are. Accessibility Label Accessibility Label (sometimes also referred to as Accessible Name) is a short string that labels the function of the control (e.g. the string "Comment" or "Sign In" on a button). Each platform Accessibility API has a mapping for these. For example, iOS has accessibilityLabel on UIAccessibilityElement. The W3C spec that defines how labels should be computed in web rendering engines is Accessible Name and Description (currently v1.1), which was split out from the ARIA spec a few years ago. The Name and Description computation section of that spec defines rules for what to do when HTML, ARIA, and other technologies combine. For example, the Currently the AccName spec is tested manually. Adding a computedLabel property to WebDriver would allow the AccName authors/maintainers to write WPT scripts that could validate the spec implementation in each browser. I expect this new capability would result in bug fixes to each engine, as well as updates/changes to the AccName spec. |
Accessibility Role Role is a reserved token value (in ARIA, For rendering engines, the two specs that best define how role should be computed are ARIA section 2.1 and the HTML Accessibility API Mappings. The interplay for example, means that |
Just seeing this... Will review now. |
WebDriver should add primitives for computedRole and computedLabel (or some equivalent names)
The engine’s computed accessibility role is exposed to web developers through developer tools (WebKit Inspector, Google DevTools, F5, etc.) but is not available in standard JavaScript contexts. Even extension developers can’t get this information.
This serves a dual benefit of allowing web authors to perform better Accessibility testing on their sites, and web spec authors to test/compare browser implementations.
The text was updated successfully, but these errors were encountered: