Problem
WCAG 2.5.3 Label in Name requires that the accessible name of a control contains the visible label text. In four files across the system module, lifecycle status links (e.g., "(Experimental)", "(Deprecated)") have an aria-label that does not contain the visible link text.
Visible text: "(Experimental)" or "Experimental"
Accessible name: "View information on the Experimental status of the module Node"
A speech recognition user who says "Click Experimental" may not match because the accessible name starts with "View information on", not "Experimental".
Proposed resolution
Change the aria-label to start with the visible link text. For modules (visible text is in parentheses):
'aria-label' => $this->t('@lifecycle (status information for @module)', [ '@lifecycle' => ucfirst($lifecycle), '@module' => $module->info['name'], ]),
For themes (visible text has no parentheses):
'aria-label' => $this->t('@lifecycle (status information for @theme)', [ '@lifecycle' => ucfirst($lifecycle), '@theme' => $theme->info['name'], ]),
For the non-stable confirm form, remove the leading space and fix the mismatch:
'aria-label' => $this->t('The @name module is deprecated. (more information)', [ '@name' => $name, ]),
Files
core/modules/system/src/Form/ModulesListForm.php— lines 262-273core/modules/system/src/Form/ModulesUninstallForm.php— lines 171-182core/modules/system/src/Controller/SystemController.php— lines 407-418core/modules/system/src/Form/ModulesListNonStableConfirmForm.php— lines 180-190
Test
Add a Functional test that:
- Enables a module with a non-stable lifecycle (experimental or deprecated)
- Visits the admin/modules page
- Asserts the lifecycle link's aria-label starts with the visible link text
- Visits the admin/modules/uninstall page
- Asserts the lifecycle link's aria-label starts with the visible link text
Related
AI Disclaimer: This was done with a lot of help from AI.
Comments
Comment #2
mgifford