bug 1270916 - use accessible->IndexInParent() in DocAccessibleChildBase::ShowEvent() r=davidb
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Thu, 10 Nov 2016 23:53:45 -0500
changeset 322922 43708cd293faa60fc2855a437602cb82d8bb9715
parent 322921 1b22ff1fe4a66ea222ea4d8217f07c0f84d75911
child 322923 387d3acae9e99bdc140a65fd367ecbaa6238f3a3
push id84000
push usertsaunders@mozilla.com
push dateThu, 17 Nov 2016 04:39:30 +0000
treeherdermozilla-inbound@387d3acae9e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1270916
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1270916 - use accessible->IndexInParent() in DocAccessibleChildBase::ShowEvent() r=davidb 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