mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 19:38:13 +00:00
Bug 1688490: Make GetNativeFromGeckoAccessible null-safe r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D103813
This commit is contained in:
parent
6b8df6efbe
commit
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user