Bug 1187611 - (part 3) Handle ProxyAccessibles in mozAccessible canBeFocused r=tbsaunde
authorLorien Hu <lorien@lorienhu.com>
Tue, 04 Aug 2015 14:56:13 -0400
changeset 256137 c9580c329762e44b7aed191c075ac01a99605e4f
parent 256136 5a9eabc1c1217a58af6bc8f8e2084c38a5547c71
child 256138 01f5097128e5e0f49aad5781fdc4b12a6a11cbc2
push id63239
push userlhu@mozilla.com
push dateTue, 04 Aug 2015 20:03:28 +0000
treeherdermozilla-inbound@689c420edf65 [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 3) Handle ProxyAccessibles in mozAccessible canBeFocused r=tbsaunde
accessible/mac/mozAccessible.mm
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -1231,18 +1231,23 @@ struct RoleDescrComparator
 
 - (BOOL)isFocused
 {
   return FocusMgr()->IsFocused([self getGeckoAccessible]);
 }
 
 - (BOOL)canBeFocused
 {
-  AccessibleWrap* accWrap = [self getGeckoAccessible];
-  return accWrap && (accWrap->InteractiveState() & states::FOCUSABLE);
+  if (AccessibleWrap* accWrap = [self getGeckoAccessible])
+      return accWrap->InteractiveState() & states::FOCUSABLE;
+
+  if (ProxyAccessible* proxy = [self getProxyAccessible])
+    return proxy->State() & states::FOCUSABLE;
+
+  return false;
 }
 
 - (BOOL)focus
 {
   if (AccessibleWrap* accWrap = [self getGeckoAccessible])
     accWrap->TakeFocus();
   else if (ProxyAccessible* proxy = [self getProxyAccessible])
     proxy->TakeFocus();