Bug 1210549 - Fix AccessibleWrap::GetXPAccessibleFor for proxied accessibles r=tbsaunde

This commit is contained in:
James Teh 2015-10-02 05:55:58 -04:00 committed by Trevor Saunders
parent ab37f2b8a2
commit f8dd54d3ca

View File

@ -1514,7 +1514,7 @@ AccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
#endif
// If it is a document then just return an accessible.
if (IsDoc())
if (child && IsDoc())
return child;
// Otherwise check whether the accessible is a child (this path works for
@ -1534,8 +1534,15 @@ AccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
if (IsProxy()) {
DocAccessibleParent* proxyDoc = Proxy()->Document();
AccessibleWrap* wrapper = GetProxiedAccessibleInSubtree(proxyDoc, id);
if (!wrapper)
return nullptr;
MOZ_ASSERT(wrapper->IsProxy());
if (proxyDoc == this->Proxy()) {
return wrapper;
}
ProxyAccessible* parent = wrapper->Proxy();
while (parent && parent != proxyDoc) {
if (parent == this->Proxy()) {
@ -1570,6 +1577,16 @@ AccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
continue;
}
if (doc == this) {
AccessibleWrap* proxyWrapper =
GetProxiedAccessibleInSubtree(remoteDocs->ElementAt(i), id);
if (proxyWrapper) {
return proxyWrapper;
}
continue;
}
Accessible* parent = outerDoc;
while (parent && parent != doc) {
if (parent == this) {