зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1688490: Make GetNativeFromGeckoAccessible null-safe r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D103813
This commit is contained in:
Родитель
6b8df6efbe
Коммит
ced0045bea
|
@ -27,7 +27,9 @@ namespace a11y {
|
|||
|
||||
inline mozAccessible* GetNativeFromGeckoAccessible(
|
||||
mozilla::a11y::AccessibleOrProxy aAccOrProxy) {
|
||||
MOZ_ASSERT(!aAccOrProxy.IsNull(), "Cannot get native from null accessible");
|
||||
if (aAccOrProxy.IsNull()) {
|
||||
return nil;
|
||||
}
|
||||
if (Accessible* acc = aAccOrProxy.AsAccessible()) {
|
||||
mozAccessible* native = nil;
|
||||
acc->GetNativeInterface((void**)&native);
|
||||
|
|
|
@ -263,10 +263,12 @@ using namespace mozilla::a11y;
|
|||
// we override this method.
|
||||
AccessibleOrProxy parentAcc = [parent geckoAccessible];
|
||||
if (!parentAcc.IsNull()) {
|
||||
mozAccessible* directGrandparent =
|
||||
GetNativeFromGeckoAccessible(parentAcc.Parent());
|
||||
if ([directGrandparent isKindOfClass:[MOXWebAreaAccessible class]]) {
|
||||
return [parent moxIgnoreWithParent:directGrandparent];
|
||||
AccessibleOrProxy grandparentAcc = parentAcc.Parent();
|
||||
if (mozAccessible* directGrandparent =
|
||||
GetNativeFromGeckoAccessible(grandparentAcc)) {
|
||||
if ([directGrandparent isKindOfClass:[MOXWebAreaAccessible class]]) {
|
||||
return [parent moxIgnoreWithParent:directGrandparent];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче