bug 1259023 - make nsIAccessible.indexInParent work on proxied accessibles r=yzen
☠☠ backed out by 6378e50f68ff ☠ ☠
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Tue, 22 Mar 2016 15:16:00 -0400
changeset 290748 358d513417fbac311304d801dddfd5c6018f96dd
parent 290747 800306e9c5733599972acd349c299664db9b3e76
child 290749 b92ce093fe6582c6d5a4879941f46e9a529cc20e
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1259023
milestone48.0a1
bug 1259023 - make nsIAccessible.indexInParent work on proxied accessibles r=yzen
accessible/xpcom/xpcAccessible.cpp
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -146,20 +146,22 @@ xpcAccessible::GetChildren(nsIArray** aC
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetIndexInParent(int32_t* aIndexInParent)
 {
   NS_ENSURE_ARG_POINTER(aIndexInParent);
   *aIndexInParent = -1;
 
-  if (!Intl())
-    return NS_ERROR_FAILURE;
+  if (IntlGeneric().IsAccessible()) {
+    *aIndexInParent = Intl()->IndexInParent();
+  } else if (IntlGeneric().IsProxy()) {
+    *aIndexInParent = IntlGeneric().AsProxy()->IndexInParent();
+  }
 
-  *aIndexInParent = Intl()->IndexInParent();
   return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDOMNode(nsIDOMNode** aDOMNode)
 {
   NS_ENSURE_ARG_POINTER(aDOMNode);
   *aDOMNode = nullptr;