Support aria-errormessage
Link to issue number:
Closes #8318
Summary of the issue:
Currently, NVDA does not read error messages referenced with aria-errormessage and aria-invalid (or platform native invalid).
Description of user facing changes
Error messages referenced by aria-errormessage are reported in speech and Braille on nodes marked as invalid.
Description of development approach
NVDAObjects have a new property, errorMessage, which is retrieved via the error IA2 relation. For virtual buffers, this is done in the virtual buffer backend and stored in the virtual buffer node. For focus mode, this is done at call-time.
Testing strategy:
Manual testing in Google Chrome and Mozilla Firefox using this Codepen and other test pages. System tests that run in Chrome have also been provided.
Known issues with pull request:
- There is no option to opt out of error message reporting. As this change may significantly increase verbosity, users may want to have the ability to stop error message reporting, or only report error messages on command. This may be particularly relevant on Braille displays, where space is at a premium.
Code Review Checklist:
- [x] Documentation:
- Change log entry
- User Documentation
- Developer / Technical Documentation
- Context sensitive help for GUI changes
- [x] Testing:
- Unit tests
- System (end to end) tests (currently do not include Braille)
- Manual testing
- [x] UX of all users considered:
- Speech
- Braille
- Low Vision
- Different web browsers
- Localization in other languages / culture than English
- [x] API is compatible with existing add-ons.
- [x] Security precautions taken.
Thanks Sascha for adding support for this. Actually this does not need an opt out option at all, for example we don't provide such an option for things like aria describedby or aria description or role:alert messages and it is still totally fine. The error message as far as I understand appears after an action has been perfomed, such as focus change or wrong data entered into a field. It is possible to stop the reporting of error message by pressing the control key.
Could you move the changes to the new changes.md for this PR please?