Bug 1554831: For out-of-process iframe documents on Windows, send the a11y emulated window (if any) to the content process. r=eeejay

If window emulation is enabled, an out-of-process iframe document should use the same emulated window as its embedder.
Previously, we were setting this on DocAccessibleParent, but we weren't sending it to content to make it available on DocAccessibleChild.
This meant that accessibles in out-of-process iframe documents were reporting the wrong window handle.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Teh 2019-05-29 04:37:28 +00:00
Родитель 0fb869ec4c
Коммит 5fd61516b3
2 изменённых файлов: 14 добавлений и 4 удалений

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

@ -561,6 +561,15 @@ ipc::IPCResult DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
// document process. This will be returned as the parent of the
// embedded document.
aChildDoc->SendParentCOMProxy(WrapperFor(outerDoc));
if (nsWinUtils::IsWindowEmulationStarted()) {
// The embedded document should use the same emulated window handle as
// its embedder. It will return the embedder document (not a window
// accessible) as the parent accessible, so we pass a null accessible
// when sending the window to the embedded document.
aChildDoc->SetEmulatedWindowHandle(mEmulatedWindowHandle);
Unused << aChildDoc->SendEmulatedWindow(
reinterpret_cast<uintptr_t>(mEmulatedWindowHandle), nullptr);
}
}
#endif // defined(XP_WIN)

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

@ -1141,10 +1141,11 @@ mozilla::ipc::IPCResult BrowserParent::RecvPDocAccessibleConstructor(
# endif
}
# ifdef XP_WIN
a11y::WrapperFor(doc)->SetID(aMsaaID);
if (a11y::nsWinUtils::IsWindowEmulationStarted()) {
doc->SetEmulatedWindowHandle(embedderDoc->GetEmulatedWindowHandle());
}
// This *must* be called after AddChildDoc because AddChildDoc
// calls ProxyCreated and WrapperFor will fail before that.
a11y::AccessibleWrap* wrapper = a11y::WrapperFor(doc);
MOZ_ASSERT(wrapper);
wrapper->SetID(aMsaaID);
# endif
return IPC_OK();
} else {