зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1407475: Fix IAccessible::accNavigate(NAVRELATION_EMBEDS) for e10s. r=surkov
When we only have a single process, this can be (and was previously) handled the same way as any other relation. However, for multi process, the normal relation mechanism doesn't work because it can't handle remote objects. This patch overrides accNavigate for the root accessible to handle this, since this is only ever used on the root. MozReview-Commit-ID: JLm5zITfG6Y --HG-- extra : rebase_source : 3666ffe699d861c06b763200e7d59fbd75a581ee
This commit is contained in:
Родитель
3b3c0e8164
Коммит
f1b4e1aa10
|
@ -102,3 +102,47 @@ RootAccessibleWrap::DocumentActivated(DocAccessible* aDocument)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
RootAccessibleWrap::accNavigate(
|
||||
/* [in] */ long navDir,
|
||||
/* [optional][in] */ VARIANT varStart,
|
||||
/* [retval][out] */ VARIANT __RPC_FAR *pvarEndUpAt)
|
||||
{
|
||||
// Special handling for NAVRELATION_EMBEDS.
|
||||
// When we only have a single process, this can be handled the same way as
|
||||
// any other relation.
|
||||
// However, for multi process, the normal relation mechanism doesn't work
|
||||
// because it can't handle remote objects.
|
||||
if (navDir != NAVRELATION_EMBEDS ||
|
||||
varStart.vt != VT_I4 || varStart.lVal != CHILDID_SELF) {
|
||||
// We only handle EMBEDS on the root here.
|
||||
// Forward to the base implementation.
|
||||
return DocAccessibleWrap::accNavigate(navDir, varStart, pvarEndUpAt);
|
||||
}
|
||||
|
||||
if (!pvarEndUpAt) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
Accessible* target = nullptr;
|
||||
// Get the document in the active tab.
|
||||
ProxyAccessible* docProxy = GetPrimaryRemoteTopLevelContentDoc();
|
||||
if (docProxy) {
|
||||
target = WrapperFor(docProxy);
|
||||
} else {
|
||||
// The base implementation could handle this, but we may as well
|
||||
// just handle it here.
|
||||
Relation rel = RelationByType(RelationType::EMBEDS);
|
||||
target = rel.Next();
|
||||
}
|
||||
|
||||
if (!target) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
VariantInit(pvarEndUpAt);
|
||||
pvarEndUpAt->pdispVal = NativeAccessible(target);
|
||||
pvarEndUpAt->vt = VT_DISPATCH;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
*/
|
||||
already_AddRefed<IUnknown> GetInternalUnknown();
|
||||
|
||||
virtual /* [id] */ HRESULT STDMETHODCALLTYPE accNavigate(
|
||||
/* [in] */ long navDir,
|
||||
/* [optional][in] */ VARIANT varStart,
|
||||
/* [retval][out] */ VARIANT __RPC_FAR *pvarEndUpAt) override;
|
||||
|
||||
private:
|
||||
// DECLARE_AGGREGATABLE declares the internal IUnknown methods as well as
|
||||
// mInternalUnknown.
|
||||
|
|
Загрузка…
Ссылка в новой задаче