Bug 1614835 - Advertise focusable state to OSX correctly. r=morgan
authorEitan Isaacson <eitan@monotonous.org>
Thu, 13 Feb 2020 00:09:16 +0000
changeset 513649 ea4df0d263f6b665940c8baff27a815c37407dd1
parent 513648 015d26a6486cd386c6b5e03a3583c7a242890d70
child 513650 854464d3cd64ec2269638ac7bb0d7bb0f3a1b673
push id37120
push usercbrindusan@mozilla.com
push dateThu, 13 Feb 2020 18:21:33 +0000
treeherdermozilla-central@b47e32ff95b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmorgan
bugs1614835
milestone75.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 1614835 - Advertise focusable state to OSX correctly. r=morgan Differential Revision: https://phabricator.services.mozilla.com/D62523
accessible/mac/mozAccessible.mm
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -993,20 +993,23 @@ struct RoleDescrComparator {
   if (AccessibleWrap* accWrap = [self getGeckoAccessible]) {
     return FocusMgr()->IsFocused(accWrap);
   }
 
   return false;  // XXX: proxy implementation is needed.
 }
 
 - (BOOL)canBeFocused {
-  if (AccessibleWrap* accWrap = [self getGeckoAccessible])
-    return accWrap->InteractiveState() & states::FOCUSABLE;
+  if (AccessibleWrap* accWrap = [self getGeckoAccessible]) {
+    return (accWrap->InteractiveState() & states::FOCUSABLE) != 0;
+  }
 
-  if (ProxyAccessible* proxy = [self getProxyAccessible]) return proxy->State() & states::FOCUSABLE;
+  if (ProxyAccessible* proxy = [self getProxyAccessible]) {
+    return (proxy->State() & states::FOCUSABLE) != 0;
+  }
 
   return false;
 }
 
 - (BOOL)focus {
   if (AccessibleWrap* accWrap = [self getGeckoAccessible])
     accWrap->TakeFocus();
   else if (ProxyAccessible* proxy = [self getProxyAccessible])