mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
bug 1107337 - Teach refChildCB to deal with proxies r=lsocks, davidb
This commit is contained in:
parent
31afa494bd
commit
7b7eced6e5
@ -11,6 +11,7 @@
|
||||
#include "InterfaceInitFuncs.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "mozilla/a11y/PDocAccessible.h"
|
||||
#include "OuterDocAccessible.h"
|
||||
#include "ProxyAccessible.h"
|
||||
#include "RootAccessible.h"
|
||||
#include "nsMai.h"
|
||||
@ -828,26 +829,45 @@ getChildCountCB(AtkObject *aAtkObj)
|
||||
AtkObject *
|
||||
refChildCB(AtkObject *aAtkObj, gint aChildIndex)
|
||||
{
|
||||
// aChildIndex should not be less than zero
|
||||
if (aChildIndex < 0) {
|
||||
// aChildIndex should not be less than zero
|
||||
if (aChildIndex < 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AtkObject* childAtkObj = nullptr;
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (accWrap) {
|
||||
if (nsAccUtils::MustPrune(accWrap)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
|
||||
if (!accChild)
|
||||
return nullptr;
|
||||
if (accChild) {
|
||||
childAtkObj = AccessibleWrap::GetAtkObject(accChild);
|
||||
} else {
|
||||
OuterDocAccessible* docOwner = accWrap->AsOuterDoc();
|
||||
if (docOwner) {
|
||||
ProxyAccessible* proxyDoc = docOwner->RemoteChildDoc();
|
||||
if (proxyDoc)
|
||||
childAtkObj = GetWrapperFor(proxyDoc);
|
||||
}
|
||||
}
|
||||
} else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
|
||||
if (proxy->MustPruneChildren())
|
||||
return nullptr;
|
||||
|
||||
AtkObject* childAtkObj = AccessibleWrap::GetAtkObject(accChild);
|
||||
ProxyAccessible* child = proxy->EmbeddedChildAt(aChildIndex);
|
||||
if (child)
|
||||
childAtkObj = GetWrapperFor(child);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
|
||||
if (!childAtkObj)
|
||||
return nullptr;
|
||||
g_object_ref(childAtkObj);
|
||||
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
|
||||
if (!childAtkObj)
|
||||
return nullptr;
|
||||
|
||||
g_object_ref(childAtkObj);
|
||||
|
||||
if (aAtkObj != childAtkObj->accessible_parent)
|
||||
atk_object_set_parent(childAtkObj, aAtkObj);
|
||||
|
Loading…
Reference in New Issue
Block a user