Bug 1590929: a11y::TraversalRule::Match: Don't assume that all Accessibles have a frame. r=MarcoZ
authorJames Teh <jteh@mozilla.com>
Mon, 04 Nov 2019 07:04:40 +0000
changeset 500324 11f08e7b4bcf06e7202e15f0ec3a3be50c906b04
parent 500323 61de50c753208632a315ef3b07786fe926768c56
child 500325 18389b50e525a6a97a3f99f48b016af1cc2082f6
push id36762
push userdvarga@mozilla.com
push dateMon, 04 Nov 2019 16:12:30 +0000
treeherdermozilla-central@fa1628003bf9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ
bugs1590929
milestone72.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 1590929: a11y::TraversalRule::Match: Don't assume that all Accessibles have a frame. r=MarcoZ I don't have a test case for this crash, but the stack suggests the frame is null. This can certainly happen for display: contents. Differential Revision: https://phabricator.services.mozilla.com/D51560
accessible/android/TraversalRule.cpp
--- a/accessible/android/TraversalRule.cpp
+++ b/accessible/android/TraversalRule.cpp
@@ -34,17 +34,17 @@ uint16_t TraversalRule::Match(Accessible
   uint64_t state = aAccessible->State();
 
   if ((state & states::INVISIBLE) != 0) {
     return result;
   }
 
   if ((state & states::OPAQUE1) == 0) {
     nsIFrame* frame = aAccessible->GetFrame();
-    if (frame->StyleEffects()->mOpacity == 0.0f) {
+    if (frame && frame->StyleEffects()->mOpacity == 0.0f) {
       return result | nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
     }
   }
 
   switch (mGranularity) {
     case java::SessionAccessibility::HTML_GRANULARITY_LINK:
       result |= LinkMatch(aAccessible);
       break;