Bug 1187611 - (part 1) Handle ProxyAccessibles in mozAccessible focus r=tbsaunde
authorLorien Hu <lorien@lorienhu.com>
Tue, 04 Aug 2015 14:56:09 -0400
changeset 256185 3cfa0ff6f2e55c771a8d33c2cc93dbb2ea2c8f05
parent 256184 081d48ca7e97320a209ed4af829b85a0caa8d76b
child 256186 5a9eabc1c1217a58af6bc8f8e2084c38a5547c71
push id29171
push usercbook@mozilla.com
push dateWed, 05 Aug 2015 11:13:29 +0000
treeherdermozilla-central@b12a261ee32e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1187611
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 1187611 - (part 1) Handle ProxyAccessibles in mozAccessible focus r=tbsaunde
accessible/mac/mozAccessible.mm
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -1237,21 +1237,23 @@ struct RoleDescrComparator
 - (BOOL)canBeFocused
 {
   AccessibleWrap* accWrap = [self getGeckoAccessible];
   return accWrap && (accWrap->InteractiveState() & states::FOCUSABLE);
 }
 
 - (BOOL)focus
 {
-  AccessibleWrap* accWrap = [self getGeckoAccessible];
-  if (!accWrap)
+  if (AccessibleWrap* accWrap = [self getGeckoAccessible])
+    accWrap->TakeFocus();
+  else if (ProxyAccessible* proxy = [self getProxyAccessible])
+    proxy->TakeFocus();
+  else
     return NO;
 
-  accWrap->TakeFocus();
   return YES;
 }
 
 - (BOOL)isEnabled
 {
   AccessibleWrap* accWrap = [self getGeckoAccessible];
   return accWrap && ((accWrap->InteractiveState() & states::UNAVAILABLE) == 0);
 }