Bug 1124681: Query State() instead of NativeState() when deciding if a checkbox is checked. r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D66489

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Morgan Reschenberg 2020-03-12 17:19:35 +00:00
Родитель e7343ec23b
Коммит 7cdb983c71
1 изменённых файлов: 5 добавлений и 10 удалений

Просмотреть файл

@ -130,11 +130,12 @@ enum CheckboxValue {
- (void)click { - (void)click {
// both buttons and checkboxes have only one action. we should really stop using arbitrary // both buttons and checkboxes have only one action. we should really stop using arbitrary
// arrays with actions, and define constants for these actions. // arrays with actions, and define constants for these actions.
if (AccessibleWrap* accWrap = [self getGeckoAccessible]) if (AccessibleWrap* accWrap = [self getGeckoAccessible]) {
accWrap->DoAction(0); accWrap->DoAction(0);
else if (ProxyAccessible* proxy = [self getProxyAccessible]) } else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
proxy->DoAction(0); proxy->DoAction(0);
} }
}
- (BOOL)isTab { - (BOOL)isTab {
if (AccessibleWrap* accWrap = [self getGeckoAccessible]) return accWrap->Role() == roles::PAGETAB; if (AccessibleWrap* accWrap = [self getGeckoAccessible]) return accWrap->Role() == roles::PAGETAB;
@ -173,15 +174,9 @@ enum CheckboxValue {
} }
- (int)isChecked { - (int)isChecked {
uint64_t state = 0;
if (AccessibleWrap* accWrap = [self getGeckoAccessible])
state = accWrap->NativeState();
else if (ProxyAccessible* proxy = [self getProxyAccessible])
state = proxy->NativeState();
// check if we're checked or in a mixed state // check if we're checked or in a mixed state
if (state & states::CHECKED) { if ([self state] & states::CHECKED) {
return (state & states::MIXED) ? kMixed : kChecked; return ([self state] & states::MIXED) ? kMixed : kChecked;
} }
return kUnchecked; return kUnchecked;