bug 1259023 - make nsIAccessible.indexInParent work on proxied accessibles r=yzen
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Tue, 22 Mar 2016 15:16:00 -0400
changeset 316768 f917fee48b339294093d42a6165ab80491a8ed61
parent 316767 ce4af341b03e8737f4cd1eec50697ae4d5e87c49
child 316769 18de7e204735f639a35302e970e68bdc97ad42fd
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [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
@@ -152,20 +152,22 @@ xpcAccessible::GetChildren(nsIArray** aC
 NS_IMETHODIMP
 xpcAccessible::GetIndexInParent(int32_t* aIndexInParent)
 {
   NS_ENSURE_ARG_POINTER(aIndexInParent);
   *aIndexInParent = -1;
   if (IntlGeneric().IsNull())
     return NS_ERROR_FAILURE;
 
-  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;