Bug 1872174 - Add programmatic role to Show All controls in Firefox View. r=fxview-reviewers,kcochrane

Several `show-all-link` controls lack interactive role - this would prevent users of speech-to-text/Voice Control from being able to send a click to it by calling its label and screen reader users and users of other assistive technology would not be able to get to this control via shortcuts like a list of controls, etc. Being focusable with keyboard does not guarantee that assistive technology could guess that this programmatically static text is, in fact, interactive.

While providing an explicit ARIA `role` to the element is going [against the First Rule of ARIA](https://www.w3.org/TR/using-aria/#rule1) while semantically appropriate HTML elements exist - `<a>` anchor (for the visual appearance of this control) or `<button>` (for the actual functionality that this control performs) - this patch would at least remove the barrier for assistive technology to be able to set interactivity expectations to this control appropriately.

No test manifests are being updated, because there are other elements in the updated test files that are failing a11y-checks, besides these `show-all-link` controls.

Differential Revision: https://phabricator.services.mozilla.com/D197349
This commit is contained in:
Anna Yeddi
2023-12-28 14:37:24 +00:00
parent 9410c0b047
commit 5b057d0148
6 changed files with 7 additions and 0 deletions

View File

@@ -396,6 +396,7 @@ class RecentlyClosedTabsInView extends ViewPage {
?hidden=${!this.isShowAllLinkVisible()}
slot="footer"
tabindex="0"
role="link"
></div>`
)}
</card-container>