Bug 1543313 part 2: Support getting an IAccessible for a ProxyAccessible in an out-of-process iframe. r=eeejay

Previously, a COM proxy was only sent from content for top level documents.
Now, a COM proxy is also sent (and needed) for out-of-process iframe documents.
This change adjusts GetProxiedAccessibleInSubtree accordingly.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Teh 2019-05-31 03:27:18 +00:00
Родитель 86e3c8af49
Коммит 6af036af5f
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -1305,15 +1305,15 @@ static already_AddRefed<IDispatch> GetProxiedAccessibleInSubtree(
auto wrapper = static_cast<DocProxyAccessibleWrap*>(WrapperFor(aDoc));
RefPtr<IAccessible> comProxy;
int32_t docWrapperChildId = AccessibleWrap::GetChildIDFor(wrapper);
// Only top level document accessible proxies are created with a pointer to
// their COM proxy.
if (aDoc->IsTopLevel()) {
// Only document accessible proxies at the top level of their content process
// are created with a pointer to their COM proxy.
if (aDoc->IsTopLevelInContentProcess()) {
wrapper->GetNativeInterface(getter_AddRefs(comProxy));
} else {
auto tab = static_cast<dom::BrowserParent*>(aDoc->Manager());
MOZ_ASSERT(tab);
DocAccessibleParent* topLevelDoc = tab->GetTopLevelDocAccessible();
MOZ_ASSERT(topLevelDoc && topLevelDoc->IsTopLevel());
MOZ_ASSERT(topLevelDoc && topLevelDoc->IsTopLevelInContentProcess());
VARIANT docId = {{{VT_I4}}};
docId.lVal = docWrapperChildId;
RefPtr<IDispatch> disp = GetProxiedAccessibleInSubtree(topLevelDoc, docId);