mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1841941: Use CreateStdAccessibleObject instead of AccessibleObjectFromWindow when getting the window IAccessible. r=nlapre
We use AccessibleObjectFromWindow to get a system generated IAccessible for the window. While this works well enough, it first sends WM_GETOBJECT to our window, goes through our window proc, etc., which is pointless since it will return nothing. We should just call CreateStdAccessibleObject directly instead, which is what the existing code ends up doing indirectly. Differential Revision: https://phabricator.services.mozilla.com/D182862
This commit is contained in:
parent
4f7447668c
commit
bac4f88bdf
@ -519,8 +519,8 @@ LazyInstantiator::get_accParent(IDispatch** ppdispParent) {
|
||||
if (!mWeakAccessible) {
|
||||
// If we'd resolve the root right now this would be the codepath we'd end
|
||||
// up in anyway. So we might as well return it here.
|
||||
return ::AccessibleObjectFromWindow(mHwnd, OBJID_WINDOW, IID_IAccessible,
|
||||
(void**)ppdispParent);
|
||||
return ::CreateStdAccessibleObject(mHwnd, OBJID_WINDOW, IID_IAccessible,
|
||||
(void**)ppdispParent);
|
||||
}
|
||||
RESOLVE_ROOT;
|
||||
return mWeakAccessible->get_accParent(ppdispParent);
|
||||
|
@ -76,7 +76,7 @@ MsaaDocAccessible::get_accParent(
|
||||
HWND hwnd = remoteDoc->GetEmulatedWindowHandle();
|
||||
MOZ_ASSERT(hwnd);
|
||||
if (hwnd &&
|
||||
SUCCEEDED(::AccessibleObjectFromWindow(
|
||||
SUCCEEDED(::CreateStdAccessibleObject(
|
||||
hwnd, OBJID_WINDOW, IID_IAccessible, (void**)ppdispParent))) {
|
||||
return S_OK;
|
||||
}
|
||||
@ -118,7 +118,7 @@ MsaaDocAccessible::get_accParent(
|
||||
}
|
||||
}
|
||||
if (hwnd &&
|
||||
SUCCEEDED(::AccessibleObjectFromWindow(
|
||||
SUCCEEDED(::CreateStdAccessibleObject(
|
||||
hwnd, OBJID_WINDOW, IID_IAccessible, (void**)ppdispParent))) {
|
||||
return S_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user