Bug 1335220 - Add minimumIncrement to windows ProxyAccessible. r=yzen

MozReview-Commit-ID: DY89qIALmrq
This commit is contained in:
Eitan Isaacson 2017-01-30 14:50:35 -08:00
parent c41740271d
commit 2725184bbf
5 changed files with 26 additions and 4 deletions

View File

@ -13,6 +13,7 @@ interface IGeckoCustom : IUnknown
[propget] HRESULT ID([out, retval] unsigned __int64* aID);
[propget] HRESULT anchorCount([out, retval] long* aCount);
[propget] HRESULT DOMNodeID([out, retval] BSTR* aID);
[propget] HRESULT minimumIncrement([out, retval] double* aIncrement);
}

View File

@ -155,6 +155,23 @@ ProxyAccessible::Value(nsString& aValue) const
aValue = (wchar_t*)resultWrap;
}
double
ProxyAccessible::Step()
{
RefPtr<IGeckoCustom> custom = QueryInterface<IGeckoCustom>(this);
if (!custom) {
return 0;
}
double increment;
HRESULT hr = custom->get_minimumIncrement(&increment);
if (FAILED(hr)) {
return 0;
}
return increment;
}
void
ProxyAccessible::Description(nsString& aDesc) const
{

View File

@ -43,3 +43,10 @@ GeckoCustom::get_ID(uint64_t* aID)
*aID = mAcc->IsDoc() ? 0 : reinterpret_cast<uintptr_t>(mAcc.get());
return S_OK;
}
STDMETHODIMP
GeckoCustom::get_minimumIncrement(double* aIncrement)
{
*aIncrement = mAcc->Step();
return S_OK;
}

View File

@ -29,6 +29,7 @@ public:
virtual STDMETHODIMP get_anchorCount(long* aCount);
virtual STDMETHODIMP get_DOMNodeID(BSTR* aID);
virtual STDMETHODIMP get_ID(uint64_t* aID);
virtual STDMETHODIMP get_minimumIncrement(double* aIncrement);
private:
GeckoCustom() = delete;

View File

@ -119,11 +119,7 @@ xpcAccessibleValue::GetMinimumIncrement(double* aValue)
if (Intl().IsAccessible()) {
value = Intl().AsAccessible()->Step();
} else {
#if defined(XP_WIN)
return NS_ERROR_NOT_IMPLEMENTED;
#else
value = Intl().AsProxy()->Step();
#endif
}
if (!IsNaN(value))