зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1749828 - Use Accessible::GroupPosition in xpcom, windows and mac. r=Jamie CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D135748
This commit is contained in:
Родитель
b494f3eab9
Коммит
81a8e4ea77
|
@ -313,12 +313,7 @@ uint16_t RotorHeadingLevelRule::Match(Accessible* aAcc) {
|
|||
// not of the desired heading level, we flip the match bit to
|
||||
// "unmatch" otherwise, the match persists.
|
||||
if ((result & nsIAccessibleTraversalRule::FILTER_MATCH)) {
|
||||
int32_t currLevel = 0;
|
||||
if (LocalAccessible* acc = aAcc->AsLocal()) {
|
||||
currLevel = acc->GroupPosition().level;
|
||||
} else if (RemoteAccessible* proxy = aAcc->AsRemote()) {
|
||||
currLevel = proxy->GroupPosition().level;
|
||||
}
|
||||
int32_t currLevel = aAcc->GroupPosition().level;
|
||||
|
||||
if (currLevel != mLevel) {
|
||||
result &= ~nsIAccessibleTraversalRule::FILTER_MATCH;
|
||||
|
|
|
@ -31,12 +31,7 @@ using namespace mozilla::a11y;
|
|||
}
|
||||
|
||||
- (id)moxValue {
|
||||
GroupPos groupPos;
|
||||
if (LocalAccessible* acc = mGeckoAccessible->AsLocal()) {
|
||||
groupPos = acc->GroupPosition();
|
||||
} else if (RemoteAccessible* proxy = mGeckoAccessible->AsRemote()) {
|
||||
groupPos = proxy->GroupPosition();
|
||||
}
|
||||
GroupPos groupPos = mGeckoAccessible->GroupPosition();
|
||||
|
||||
return [NSNumber numberWithInt:groupPos.level];
|
||||
}
|
||||
|
|
|
@ -602,12 +602,8 @@ enum CachedBool { eCachedBoolMiss, eCachedTrue, eCachedFalse };
|
|||
}
|
||||
|
||||
- (NSNumber*)moxDisclosureLevel {
|
||||
GroupPos groupPos;
|
||||
if (LocalAccessible* acc = mGeckoAccessible->AsLocal()) {
|
||||
groupPos = acc->GroupPosition();
|
||||
} else if (RemoteAccessible* proxy = mGeckoAccessible->AsRemote()) {
|
||||
groupPos = proxy->GroupPosition();
|
||||
}
|
||||
GroupPos groupPos = mGeckoAccessible->GroupPosition();
|
||||
|
||||
// mac expects 0-indexed levels, but groupPos.level is 1-indexed
|
||||
// so we subtract 1 here for levels above 0
|
||||
return groupPos.level > 0 ? @(groupPos.level - 1) : @(groupPos.level);
|
||||
|
|
|
@ -249,13 +249,10 @@ ia2Accessible::get_groupPosition(long* aGroupLevel, long* aSimilarItemsInGroup,
|
|||
*aSimilarItemsInGroup = 0;
|
||||
*aPositionInGroup = 0;
|
||||
|
||||
if (!Acc()) {
|
||||
Accessible* acc = Acc();
|
||||
if (acc) {
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
}
|
||||
AccessibleWrap* acc = LocalAcc();
|
||||
if (!acc) {
|
||||
return E_NOTIMPL; // XXX Not supported for RemoteAccessible yet.
|
||||
}
|
||||
|
||||
GroupPos groupPos = acc->GroupPosition();
|
||||
|
||||
|
|
|
@ -452,24 +452,20 @@ xpcAccessible::GroupPosition(int32_t* aGroupLevel,
|
|||
int32_t* aSimilarItemsInGroup,
|
||||
int32_t* aPositionInGroup) {
|
||||
NS_ENSURE_ARG_POINTER(aGroupLevel);
|
||||
*aGroupLevel = 0;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
|
||||
*aSimilarItemsInGroup = 0;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aPositionInGroup);
|
||||
*aPositionInGroup = 0;
|
||||
|
||||
GroupPos groupPos;
|
||||
if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
|
||||
groupPos = acc->GroupPosition();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
if (IntlGeneric()->IsRemote() &&
|
||||
!StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
*aGroupLevel = 0;
|
||||
*aSimilarItemsInGroup = 0;
|
||||
*aPositionInGroup = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
groupPos = IntlGeneric()->AsRemote()->GroupPosition();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
GroupPos groupPos = IntlGeneric()->GroupPosition();
|
||||
|
||||
*aGroupLevel = groupPos.level;
|
||||
*aSimilarItemsInGroup = groupPos.setSize;
|
||||
|
|
Загрузка…
Ссылка в новой задаче