mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1107337 - Teach refChildCB to deal with proxies r=lsocks, davidb
This commit is contained in:
parent
2e34b54154
commit
4a9a25c9f1
@ -11,6 +11,7 @@
|
|||||||
#include "InterfaceInitFuncs.h"
|
#include "InterfaceInitFuncs.h"
|
||||||
#include "nsAccUtils.h"
|
#include "nsAccUtils.h"
|
||||||
#include "mozilla/a11y/PDocAccessible.h"
|
#include "mozilla/a11y/PDocAccessible.h"
|
||||||
|
#include "OuterDocAccessible.h"
|
||||||
#include "ProxyAccessible.h"
|
#include "ProxyAccessible.h"
|
||||||
#include "RootAccessible.h"
|
#include "RootAccessible.h"
|
||||||
#include "nsMai.h"
|
#include "nsMai.h"
|
||||||
@ -828,26 +829,45 @@ getChildCountCB(AtkObject *aAtkObj)
|
|||||||
AtkObject *
|
AtkObject *
|
||||||
refChildCB(AtkObject *aAtkObj, gint aChildIndex)
|
refChildCB(AtkObject *aAtkObj, gint aChildIndex)
|
||||||
{
|
{
|
||||||
// aChildIndex should not be less than zero
|
// aChildIndex should not be less than zero
|
||||||
if (aChildIndex < 0) {
|
if (aChildIndex < 0) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
AtkObject* childAtkObj = nullptr;
|
||||||
|
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||||
|
if (accWrap) {
|
||||||
|
if (nsAccUtils::MustPrune(accWrap)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
|
||||||
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
|
Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
|
||||||
if (!accChild)
|
if (accChild) {
|
||||||
return nullptr;
|
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");
|
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
|
||||||
if (!childAtkObj)
|
if (!childAtkObj)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
g_object_ref(childAtkObj);
|
|
||||||
|
g_object_ref(childAtkObj);
|
||||||
|
|
||||||
if (aAtkObj != childAtkObj->accessible_parent)
|
if (aAtkObj != childAtkObj->accessible_parent)
|
||||||
atk_object_set_parent(childAtkObj, aAtkObj);
|
atk_object_set_parent(childAtkObj, aAtkObj);
|
||||||
|
Loading…
Reference in New Issue
Block a user