mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1668142 - Support AXDirectionPrevious in rotor with no start element. r=morgan
Depends on D91875 Differential Revision: https://phabricator.services.mozilla.com/D91878
This commit is contained in:
parent
f4182287b4
commit
34f9d53bb7
@ -77,9 +77,22 @@ using namespace mozilla::a11y;
|
||||
AccessibleOrProxy geckoRootAcc = [self rootGeckoAccessible];
|
||||
AccessibleOrProxy geckoStartAcc = [self startGeckoAccessible];
|
||||
Pivot p = Pivot(geckoRootAcc);
|
||||
AccessibleOrProxy match = mSearchForward ? p.Next(geckoStartAcc, rule)
|
||||
: p.Prev(geckoStartAcc, rule);
|
||||
AccessibleOrProxy match;
|
||||
if (mSearchForward) {
|
||||
match = p.Next(geckoStartAcc, rule);
|
||||
} else {
|
||||
if (geckoRootAcc == geckoStartAcc) {
|
||||
match = p.Last(rule);
|
||||
} else {
|
||||
match = p.Prev(geckoStartAcc, rule);
|
||||
}
|
||||
}
|
||||
|
||||
while (!match.IsNull() && resultLimit != 0) {
|
||||
if (!mSearchForward && match == geckoRootAcc) {
|
||||
break;
|
||||
}
|
||||
|
||||
// we use mResultLimit != 0 to capture the case where mResultLimit is -1
|
||||
// when it is set from the params dictionary. If that's true, we want
|
||||
// to return all matches (ie. have no limit)
|
||||
|
@ -1521,5 +1521,23 @@ addAccessibleTask(
|
||||
["p2"],
|
||||
"Result is next group sibling"
|
||||
);
|
||||
|
||||
searchPred = {
|
||||
AXSearchKey: "AXAnyTypeSearchKey",
|
||||
AXImmediateDescendantsOnly: 1,
|
||||
AXResultsLimit: -1,
|
||||
AXDirection: "AXDirectionPrevious",
|
||||
};
|
||||
|
||||
results = searchRoot.getParameterizedAttributeValue(
|
||||
"AXUIElementsForSearchPredicate",
|
||||
NSDictionary(searchPred)
|
||||
);
|
||||
|
||||
Assert.deepEqual(
|
||||
results.map(r => r.getAttributeValue("AXDOMIdentifier")),
|
||||
["p2", "p1"],
|
||||
"A reverse search should return groups in reverse"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user