diff --git a/browser/base/content/test/tabs/browser.toml b/browser/base/content/test/tabs/browser.toml
index b810b27ee344c..8008d70f0c8b5 100644
--- a/browser/base/content/test/tabs/browser.toml
+++ b/browser/base/content/test/tabs/browser.toml
@@ -236,7 +236,7 @@ support-files = [
]
["browser_overflowScroll.js"]
-fail-if = ["a11y_checks"] # Bug 1854233 scrollbutton-down/up may not be focusable and/or labeled
+fail-if = ["a11y_checks"] # Bugs 1854233 and 1873049 scrollbutton-down/up are not labeled
skip-if = [
"win11_2009", # Bug 1797751
]
diff --git a/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js b/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js
index e292f47724a54..0b9c6e3d6bff9 100644
--- a/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js
+++ b/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js
@@ -233,18 +233,27 @@ this.AccessibilityUtils = (function () {
if (!node || !node.ownerGlobal) {
return false;
}
- const toolbar = node.closest("toolbar");
+ const toolbar =
+ node.closest("toolbar") ||
+ node.flattenedTreeParentNode.closest("toolbar");
if (!toolbar || toolbar.getAttribute("keyNav") != "true") {
return false;
}
// The Go button in the Url Bar is an example of a purposefully
// non-focusable image toolbar button that provides an mouse/touch-only
// control for the search query submission, while a keyboard user could
- // press `Enter` to do it. We do not want to create an extra tab stop for
- // such controls and the markup would include `keyNav="false"` to flag it.
+ // press `Enter` to do it. Similarly, two scroll buttons that appear when
+ // toolbar is overflowing, and keyboard-only users would actually scroll
+ // tabs in the toolbar while trying to navigate to these controls. When
+ // toolbarbuttons are redundant for keyboard users, we do not want to
+ // create an extra tab stop for such controls, thus we are expecting the
+ // button markup to include `keyNav="false"` attribute to flag it.
if (node.getAttribute("keyNav") == "false") {
const ariaRoles = getAriaRoles(accessible);
- return ariaRoles.includes("button");
+ return (
+ ariaRoles.includes("button") ||
+ accessible.role == Ci.nsIAccessibleRole.ROLE_PUSHBUTTON
+ );
}
return node.ownerGlobal.ToolbarKeyboardNavigator._isButton(node);
}
diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js
index b4e421f6ff676..28de96c8d7c5d 100644
--- a/toolkit/content/widgets/arrowscrollbox.js
+++ b/toolkit/content/widgets/arrowscrollbox.js
@@ -21,7 +21,7 @@
return `
-
+
@@ -29,7 +29,7 @@
-
+
`;
}