bug 1270916 - use accessible->IndexInParent() in DocAccessibleChildBase::ShowEvent() r=davidb a=jcristau
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Thu, 10 Nov 2016 23:53:45 -0500
changeset 352968 ad4d2db7aa2d802d5446e8e30640b9777b296878
parent 352967 26328ca1d4b6839770f534fb936ee8b70ec99e98
child 352969 e92c50c1c5cdd95b59f0a72f15e3aa2841908beb
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb, jcristau
bugs1270916
milestone52.0a2
bug 1270916 - use accessible->IndexInParent() in DocAccessibleChildBase::ShowEvent() r=davidb a=jcristau Since we will fire events in the correct order we can use the index of the event target at the time the event is fired. This protects from weird cases where the target is inserted, and then children before the target are removed.
accessible/ipc/DocAccessibleChildBase.cpp
--- a/accessible/ipc/DocAccessibleChildBase.cpp
+++ b/accessible/ipc/DocAccessibleChildBase.cpp
@@ -80,17 +80,17 @@ DocAccessibleChildBase::SerializeTree(Ac
   }
 }
 
 void
 DocAccessibleChildBase::ShowEvent(AccShowEvent* aShowEvent)
 {
   Accessible* parent = aShowEvent->Parent();
   uint64_t parentID = parent->IsDoc() ? 0 : reinterpret_cast<uint64_t>(parent->UniqueID());
-  uint32_t idxInParent = aShowEvent->InsertionIndex();
+  uint32_t idxInParent = aShowEvent->GetAccessible()->IndexInParent();
   nsTArray<AccessibleData> shownTree;
   ShowEventData data(parentID, idxInParent, shownTree);
   SerializeTree(aShowEvent->GetAccessible(), data.NewTree());
   SendShowEvent(data, aShowEvent->IsFromUserInput());
 }
 
 } // namespace a11y
 } // namespace mozilla