Bug 1518805 - Don't update bounds on gone or defunct accessibles. r=MarcoZ
authorEitan Isaacson <eitan@monotonous.org>
Thu, 10 Jan 2019 06:59:16 +0000
changeset 510312 460f0359741bd0026b7da0426836e1c0084a5be3
parent 510311 6d3e6c915370bc5e771429c0a207950db64b7089
child 510313 87e21b003b079e91d7e833853116a343fcae8cee
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ
bugs1518805
milestone66.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 1518805 - Don't update bounds on gone or defunct accessibles. r=MarcoZ Differential Revision: https://phabricator.services.mozilla.com/D16064
accessible/android/DocAccessibleWrap.cpp
--- a/accessible/android/DocAccessibleWrap.cpp
+++ b/accessible/android/DocAccessibleWrap.cpp
@@ -246,15 +246,20 @@ void DocAccessibleWrap::UpdateFocusPathB
           UnspecifiedNaN<double>(), nsTArray<Attribute>()));
     }
 
     ipcDoc->SendBatch(eBatch_BoundsUpdate, boundsData);
   } else if (SessionAccessibility* sessionAcc =
                  SessionAccessibility::GetInstanceFor(this)) {
     nsTArray<AccessibleWrap*> accessibles(mFocusPath.Count());
     for (auto iter = mFocusPath.Iter(); !iter.Done(); iter.Next()) {
-      accessibles.AppendElement(
-          static_cast<AccessibleWrap*>(iter.Data().get()));
+      Accessible* accessible = iter.Data();
+      if (!accessible || accessible->IsDefunct()) {
+        MOZ_ASSERT_UNREACHABLE("Focus path cached accessible is gone.");
+        continue;
+      }
+
+      accessibles.AppendElement(static_cast<AccessibleWrap*>(accessible));
     }
 
     sessionAcc->UpdateCachedBounds(accessibles);
   }
 }