bug 1243077 - add ToXPC{,Document} overloads for proxied accessibles r=davidb

This commit is contained in:
Trevor Saunders 2016-01-22 05:52:53 -05:00
parent 1fbafdb262
commit 9ec7157cf1
2 changed files with 24 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#include "DocAccessible-inl.h"
#include "nsIDOMDocument.h"
using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
@ -227,3 +228,18 @@ xpcAccessibleDocument::Shutdown()
}
xpcAccessibleGeneric::Shutdown();
}
xpcAccessibleGeneric*
a11y::ToXPC(AccessibleOrProxy aAcc)
{
if (aAcc.IsNull()) {
return nullptr;
}
if (aAcc.IsAccessible()) {
return ToXPC(aAcc.AsAccessible());
}
xpcAccessibleDocument* doc = ToXPCDocument(aAcc.AsProxy()->Document());
return doc->GetXPCAccessible(aAcc.AsProxy());
}

View File

@ -118,6 +118,8 @@ ToXPC(Accessible* aAccessible)
return xpcDoc ? xpcDoc->GetAccessible(aAccessible) : nullptr;
}
xpcAccessibleGeneric* ToXPC(AccessibleOrProxy aAcc);
inline xpcAccessibleHyperText*
ToXPCText(HyperTextAccessible* aAccessible)
{
@ -135,6 +137,12 @@ ToXPCDocument(DocAccessible* aAccessible)
return GetAccService()->GetXPCDocument(aAccessible);
}
inline xpcAccessibleDocument*
ToXPCDocument(DocAccessibleParent* aAccessible)
{
return GetAccService()->GetXPCDocument(aAccessible);
}
} // namespace a11y
} // namespace mozilla