Bug 1594300: Implement xpcAccessible::TakeFocus for ProxyAccessibles on Windows. r=yzen

1. Implement ProxyAccessible::TakeFocus on Windows.
2. Use this implementation in xpcAccessible::TakeFocus like we do on other platforms.
3. Enable accessible/tests/browser/fission/browser_take_focus.js on Windows, since it now works.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Teh 2020-01-15 14:52:46 +00:00
Родитель 47152527c5
Коммит b2a45adc2b
3 изменённых файлов: 9 добавлений и 5 удалений

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

@ -724,5 +724,13 @@ void ProxyAccessible::DOMNodeID(nsString& aID) {
aID = (wchar_t*)resultWrap;
}
void ProxyAccessible::TakeFocus() {
RefPtr<IAccessible> acc;
if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
return;
}
acc->accSelect(SELFLAG_TAKEFOCUS, kChildIdSelf);
}
} // namespace a11y
} // namespace mozilla

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

@ -12,4 +12,4 @@ support-files =
[browser_reframe_visibility.js]
[browser_src_change.js]
[browser_take_focus.js]
skip-if = fission || (os == 'win') # Bug 1556627 and 1594300 xpcAccessible::TakeFocus() is not implemented on Windows with e10s.
skip-if = fission # Bug 1556627

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

@ -636,11 +636,7 @@ xpcAccessible::TakeFocus() {
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
if (ProxyAccessible* proxy = IntlGeneric().AsProxy()) {
#if defined(XP_WIN)
return NS_ERROR_NOT_IMPLEMENTED;
#else
proxy->TakeFocus();
#endif
} else {
Intl()->TakeFocus();
}