author | James Teh <jteh@mozilla.com> |
Wed, 11 Oct 2017 15:30:22 +1000 | |
changeset 386105 | e0f3918c6e30229d4c69d7288c943a3709a6a4f7 |
parent 386104 | 11d5208791fed061fdeb0e0ecd031dbcf676bf12 |
child 386106 | a9a3eb7320f53a53ec9d1c5b4e1a2469c53c79a6 |
push id | 32675 |
push user | archaeopteryx@coole-files.de |
push date | Fri, 13 Oct 2017 21:36:21 +0000 |
treeherder | mozilla-central@684b9ee0468e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | surkov |
bugs | 1407475 |
milestone | 58.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
accessible/windows/msaa/RootAccessibleWrap.cpp | file | annotate | diff | comparison | revisions | |
accessible/windows/msaa/RootAccessibleWrap.h | file | annotate | diff | comparison | revisions |
--- a/accessible/windows/msaa/RootAccessibleWrap.cpp +++ b/accessible/windows/msaa/RootAccessibleWrap.cpp @@ -97,8 +97,52 @@ RootAccessibleWrap::DocumentActivated(Do HWND childDocHWND = static_cast<HWND>(childDoc->GetNativeWindow()); if (childDoc != aDocument) nsWinUtils::HideNativeWindow(childDocHWND); else nsWinUtils::ShowNativeWindow(childDocHWND); } } } + +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; +}
--- a/accessible/windows/msaa/RootAccessibleWrap.h +++ b/accessible/windows/msaa/RootAccessibleWrap.h @@ -33,16 +33,21 @@ public: already_AddRefed<IUnknown> Aggregate(IUnknown* aOuter); /** * @return This object's own IUnknown, as opposed to its wrapper's IUnknown * which is what would be returned by QueryInterface(IID_IUnknown). */ 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. DECLARE_AGGREGATABLE(RootAccessibleWrap); IUnknown* mOuter; }; } // namespace a11y