commit 29e38f2fdd57ddf31ebe9fe6ac3483d87921cb23
parent 0f7b9bd615a8bda5995a0e58a71728ab76c27d58
Author: James Teh <jteh@mozilla.com>
Date: Mon, 13 Oct 2025 18:37:22 +0000
Bug 1990703: Don't call getAccessible in AccessibilityUtils.isKeyboardFocusableSpinbuttonSibling. r=ayeddi
Calling getAccessible forces a refresh tick in some cases.
Forcing a refresh tick allows accessibility tree updates to run.
This might cause problems if the Accessible we're checking gets recreated for whatever reason, since that will cause the Accessible to die while we're still querying it.
Ideally, we'd avoid recreating it in the first place, but this might be tricky to diagnose.
It's probably best to avoid extra refresh ticks if we can anyway.
Instead of querying the sibling Accessible, we just query the sibling DOM node directly.
This is sufficient for our purposes, albeit less generalised.
Differential Revision: https://phabricator.services.mozilla.com/D267904
Diffstat:
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js b/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js
@@ -405,15 +405,7 @@ this.AccessibilityUtils = (function () {
node.previousElementSibling,
node.nextElementSibling,
]) {
- if (!sibling) {
- continue;
- }
- const siblingAcc = getAccessible(sibling);
- if (
- siblingAcc &&
- siblingAcc.role == Ci.nsIAccessibleRole.ROLE_SPINBUTTON &&
- matchState(siblingAcc, STATE_FOCUSABLE)
- ) {
+ if (sibling && sibling.tabIndex >= 0 && sibling.role == "spinbutton") {
return true;
}
}