mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Bug 1269369 - add support for GetID XPCOM method on Windows with e10s. r=tbsaunde
MozReview-Commit-ID: KXhDeNW3Oaw
This commit is contained in:
parent
485f64c28c
commit
4a9e23d316
@ -12,6 +12,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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -706,5 +706,23 @@ ProxyAccessible::AnchorAt(uint32_t aIdx)
|
||||
return proxyAnchor;
|
||||
}
|
||||
|
||||
void
|
||||
ProxyAccessible::DOMNodeID(nsString& aID)
|
||||
{
|
||||
aID.Truncate();
|
||||
RefPtr<IGeckoCustom> custom = QueryInterface<IGeckoCustom>(this);
|
||||
if (!custom) {
|
||||
return;
|
||||
}
|
||||
|
||||
BSTR result;
|
||||
HRESULT hr = custom->get_DOMNodeID(&result);
|
||||
_bstr_t resultWrap(result, false);
|
||||
if (FAILED(hr)) {
|
||||
return;
|
||||
}
|
||||
aID = (wchar_t*)resultWrap;
|
||||
}
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
@ -20,6 +20,23 @@ GeckoCustom::get_anchorCount(long* aCount)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
GeckoCustom::get_DOMNodeID(BSTR* aID)
|
||||
{
|
||||
nsIContent* content = mAcc->GetContent();
|
||||
if (!content) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
nsIAtom* id = content->GetID();
|
||||
if (id) {
|
||||
nsAutoString idStr;
|
||||
id->ToString(idStr);
|
||||
*aID = ::SysAllocStringLen(idStr.get(), idStr.Length());
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
GeckoCustom::get_ID(uint64_t* aID)
|
||||
{
|
||||
|
@ -27,6 +27,7 @@ public:
|
||||
DECL_IUNKNOWN
|
||||
|
||||
virtual STDMETHODIMP get_anchorCount(long* aCount);
|
||||
virtual STDMETHODIMP get_DOMNodeID(BSTR* aID);
|
||||
virtual STDMETHODIMP get_ID(uint64_t* aID);
|
||||
|
||||
private:
|
||||
|
@ -195,9 +195,6 @@ xpcAccessible::GetDOMNode(nsIDOMNode** aDOMNode)
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetId(nsAString& aID)
|
||||
{
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
ProxyAccessible* proxy = IntlGeneric().AsProxy();
|
||||
if (!proxy) {
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -208,7 +205,6 @@ xpcAccessible::GetId(nsAString& aID)
|
||||
aID.Assign(id);
|
||||
|
||||
return NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
x
Reference in New Issue
Block a user