Bug 1657665: Filter pivot matches for which there is no corresponding native accessible. r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D86264
This commit is contained in:
Morgan Reschenberg 2020-08-06 21:42:03 +00:00
parent a679ee84cf
commit e4bdad9acd

View File

@ -138,8 +138,14 @@ using namespace mozilla::a11y;
// 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)
[matches addObject:GetNativeFromGeckoAccessible(match)];
resultLimit -= 1;
mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(match);
if (nativeMatch) {
// only add/count results for which there is a matching
// native accessible
[matches addObject:nativeMatch];
resultLimit -= 1;
}
match = mSearchForward ? p.Next(match, rule) : p.Prev(match, rule);
}