Bug 1187417 - (Part 2) Check for ProxyAccessible in mozAccessible size r=tbsaunde

This commit is contained in:
Lorien Hu 2015-07-26 10:33:51 -04:00
parent 8c44000823
commit 0e4cfe6db9

View File

@ -873,11 +873,14 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
{ {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
AccessibleWrap* accWrap = [self getGeckoAccessible]; nsIntRect rect;
if (!accWrap) if (AccessibleWrap* accWrap = [self getGeckoAccessible])
rect = accWrap->Bounds();
else if (ProxyAccessible* proxy = [self getProxyAccessible])
rect = proxy->Bounds();
else
return nil; return nil;
nsIntRect rect = accWrap->Bounds();
CGFloat scaleFactor = CGFloat scaleFactor =
nsCocoaUtils::GetBackingScaleFactor([[NSScreen screens] objectAtIndex:0]); nsCocoaUtils::GetBackingScaleFactor([[NSScreen screens] objectAtIndex:0]);
return [NSValue valueWithSize:NSMakeSize(static_cast<CGFloat>(rect.width) / scaleFactor, return [NSValue valueWithSize:NSMakeSize(static_cast<CGFloat>(rect.width) / scaleFactor,