зеркало из https://github.com/mozilla/gecko-dev.git
Backing out for now
This commit is contained in:
Родитель
14a3ec20d9
Коммит
06d750b78a
|
@ -902,45 +902,12 @@ refChildCB(AtkObject *aAtkObj, gint aChildIndex)
|
||||||
gint
|
gint
|
||||||
getIndexInParentCB(AtkObject *aAtkObj)
|
getIndexInParentCB(AtkObject *aAtkObj)
|
||||||
{
|
{
|
||||||
// This does not use nsIAccessible::GetIndexInParent() because
|
|
||||||
// we only count embedded objects as children (e.g. not TEXT_LEAF nodes)
|
|
||||||
NS_ENSURE_SUCCESS(CheckMaiAtkObject(aAtkObj), -1);
|
NS_ENSURE_SUCCESS(CheckMaiAtkObject(aAtkObj), -1);
|
||||||
nsAccessibleWrap *accWrap =
|
nsAccessibleWrap *accWrap =
|
||||||
NS_REINTERPRET_CAST(MaiAtkObject*, aAtkObj)->accWrap;
|
NS_REINTERPRET_CAST(MaiAtkObject*, aAtkObj)->accWrap;
|
||||||
|
|
||||||
if (!mWeakShell) {
|
PRInt32 currentIndex = -1;
|
||||||
return -1;
|
accWrap->GetIndexInParent(¤tIndex);
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessible> parent;
|
|
||||||
accWrap->GetParent(getter_AddRefs(parent));
|
|
||||||
if (!parent) {
|
|
||||||
return -1; // No parent
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessible> sibling;
|
|
||||||
parent->GetFirstChild(getter_AddRefs(sibling));
|
|
||||||
if (!sibling) {
|
|
||||||
return -1; // Error, parent has no children
|
|
||||||
}
|
|
||||||
|
|
||||||
PRInt32 currentIndex = 0;
|
|
||||||
|
|
||||||
while (!SameCOMIdentity(sibling, accWrap)) {
|
|
||||||
NS_ASSERTION(sibling, "Never ran into the same child that we started from");
|
|
||||||
|
|
||||||
if (!sibling) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (IsEmbeddedObject(sibling)) {
|
|
||||||
++ currentIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessible> tempAccessible;
|
|
||||||
sibling->GetNextSibling(getter_AddRefs(tempAccessible));
|
|
||||||
sibling.swap(tempAccessible);
|
|
||||||
}
|
|
||||||
|
|
||||||
return currentIndex;
|
return currentIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче