Bug 1171995 - Part 4: Handle proxies in mozAccessible accessibilityAttributeNames r=tbsaunde
authorLorien Hu <lorien@lorienhu.com>
Thu, 16 Jul 2015 17:34:52 -0400
changeset 253298 79131088413abc7fc2f331c97103ee5d9407f47b
parent 253297 5c981fda1d41e332c02ef800d3f7394db1de3916
child 253299 73f2e7591ff02eecfc7de1961d2debac799a3941
push id62398
push userlhu@mozilla.com
push dateThu, 16 Jul 2015 21:35:56 +0000
treeherdermozilla-inbound@5a04fa687d38 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1171995
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1171995 - Part 4: Handle proxies in mozAccessible accessibilityAttributeNames r=tbsaunde
accessible/mac/mozAccessible.mm
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -269,17 +269,18 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
 }
 
 - (NSArray*)accessibilityAttributeNames
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   // if we're expired, we don't support any attributes.
   AccessibleWrap* accWrap = [self getGeckoAccessible];
-  if (!accWrap)
+  ProxyAccessible* proxy = [self getProxyAccessible];
+  if (!accWrap && !proxy)
     return [NSArray array];
 
   static NSArray* generalAttributes = nil;
   static NSArray* tableAttrs = nil;
   static NSArray* tableRowAttrs = nil;
   static NSArray* tableCellAttrs = nil;
   NSMutableArray* tempArray = nil;
 
@@ -328,21 +329,21 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
     [tempArray addObject:NSAccessibilityRowHeaderUIElementsAttribute];
     [tempArray addObject:NSAccessibilityColumnHeaderUIElementsAttribute];
     tableCellAttrs = [[NSArray alloc] initWithArray:tempArray];
     [tempArray release];
   }
 
   NSArray* objectAttributes = generalAttributes;
 
-  if (accWrap->IsTable())
+  if ((accWrap && accWrap->IsTable()) || (proxy && proxy->IsTable()))
     objectAttributes = tableAttrs;
-  else if (accWrap->IsTableRow())
+  else if ((accWrap && accWrap->IsTableRow()) || (proxy && proxy->IsTableRow()))
     objectAttributes = tableRowAttrs;
-  else if (accWrap->IsTableCell())
+  else if ((accWrap && accWrap->IsTableCell()) || (proxy && proxy->IsTableCell()))
     objectAttributes = tableCellAttrs;
 
   NSArray* additionalAttributes = [self additionalAccessibilityAttributeNames];
   if ([additionalAttributes count])
     objectAttributes = [objectAttributes arrayByAddingObjectsFromArray:additionalAttributes];
 
   return objectAttributes;