Skip to content

Commit 393c1a8

Browse files
committed
Bug 1873049 - Provide accessible names to both tabs overflow scrollbuttons. r=dao,reusable-components-reviewers,eemeli
`scrollbutton-down` and `scrollbutton-up` toolbarbuttons are not labeled and it would prevent users of assistive technology from knowing their purpose and, for instance, speech-to-text software users won't be able to activate them by calling their name and screen reader users won't know what these controls are expected to do, when passing through them in a browse mode or in a list of buttons/controls. Differential Revision: https://phabricator.services.mozilla.com/D197705
1 parent 6019a24 commit 393c1a8

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

browser/base/content/test/tabs/browser.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ support-files = [
236236
]
237237

238238
["browser_overflowScroll.js"]
239-
fail-if = ["a11y_checks"] # Bugs 1854233 and 1873049 scrollbutton-down/up are not labeled
240239
skip-if = [
241240
"win11_2009", # Bug 1797751
242241
]

toolkit/content/widgets/arrowscrollbox.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
return `
2222
<html:link rel="stylesheet" href="chrome://global/skin/toolbarbutton.css"/>
2323
<html:link rel="stylesheet" href="chrome://global/skin/arrowscrollbox.css"/>
24-
<toolbarbutton id="scrollbutton-up" part="scrollbutton-up" keyNav="false"/>
24+
<toolbarbutton id="scrollbutton-up" part="scrollbutton-up" keyNav="false" data-l10n-id="overflow-scroll-button-up"/>
2525
<spacer part="overflow-start-indicator"/>
2626
<box class="scrollbox-clip" part="scrollbox-clip" flex="1">
2727
<scrollbox part="scrollbox" flex="1">
2828
<html:slot/>
2929
</scrollbox>
3030
</box>
3131
<spacer part="overflow-end-indicator"/>
32-
<toolbarbutton id="scrollbutton-down" part="scrollbutton-down" keyNav="false"/>
32+
<toolbarbutton id="scrollbutton-down" part="scrollbutton-down" keyNav="false" data-l10n-id="overflow-scroll-button-down"/>
3333
`;
3434
}
3535

@@ -43,6 +43,8 @@
4343
this._scrollButtonDown =
4444
this.shadowRoot.getElementById("scrollbutton-down");
4545

46+
MozXULElement.insertFTLIfNeeded("toolkit/global/arrowscrollbox.ftl");
47+
4648
this._arrowScrollAnim = {
4749
scrollbox: this,
4850
requestHandle: 0,
@@ -134,6 +136,8 @@
134136
}
135137
this.hasConnected = true;
136138

139+
document.l10n.connectRoot(this.shadowRoot);
140+
137141
if (!this.hasAttribute("smoothscroll")) {
138142
this.smoothScroll = Services.prefs.getBoolPref(
139143
"toolkit.scrollbox.smoothScroll",
@@ -639,6 +643,7 @@
639643
this._scrollTimer.cancel();
640644
this._scrollTimer = null;
641645
}
646+
document.l10n.disconnectRoot(this.shadowRoot);
642647
}
643648

644649
on_wheel(event) {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
### This file contains the entities needed to use the Arrowscrollbox component.
6+
### For example, Arrowscrollboxes are used in Tabs Toolbar when there are
7+
### multiple tabs opened and in the overflowing menus.
8+
9+
# This button is shown at the beginning of the overflowing list of elements.
10+
# For example, in LTR language like English, on the Tabs Toolbar it would look
11+
# like "<" and scroll the tab list to the left, and in the overflowing menu it
12+
# would look like "^" and scroll the list of menuitems up.
13+
overflow-scroll-button-up =
14+
.tooltiptext = Scroll up
15+
# This button is shown at the end of the overflowing list of elements. For
16+
# example, in LTR language like English, on the Tabs Toolbar it would look like
17+
# ">" and scroll the tab list to the right, and in the overflowing menu it
18+
# would look like "v" and scroll the list of menuitems down.
19+
overflow-scroll-button-down =
20+
.tooltiptext = Scroll down

0 commit comments

Comments
 (0)