Bug 1212133 - Ensure the node has a container r=davidb a=ritu
authorWes Kocher <wkocher@mozilla.com>
Thu, 07 Jan 2016 10:53:24 -0800
changeset 304205 ac1d763699d4a69f2fc5d6f2086283b398e16368
parent 304204 2b96b7c71910c24c32ef825e3deb280ebed13ef1
child 304206 35655c81d4e6d6b866fed86c026bb5657ac5417a
push id5469
push userkwierso@gmail.com
push dateThu, 07 Jan 2016 19:34:44 +0000
treeherdermozilla-beta@97c3b29fb4f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb, ritu
bugs1212133
milestone44.0
Bug 1212133 - Ensure the node has a container r=davidb a=ritu
accessible/generic/DocAccessible.cpp
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1730,17 +1730,18 @@ DocAccessible::RemoveDependentIDsFor(Acc
                 reorderEvent->AddSubMutationEvent(hideEvent);
 
                 aRelProvider->RemoveChild(child);
               }
 
               // Collect DOM-order containers to update their trees.
               child->SetRepositioned(false);
               Accessible* container = GetContainerAccessible(childEl);
-              if (!containers.Contains(container)) {
+              MOZ_ASSERT(container, "A node should always have a container");
+              if (container && !containers.Contains(container)) {
                 containers.AppendElement(container);
               }
             }
           }
         }
 
         mARIAOwnsHash.Remove(aRelProvider);
         for (uint32_t idx = 0; idx < mARIAOwnsInvalidationList.Length();) {
@@ -1752,17 +1753,19 @@ DocAccessible::RemoveDependentIDsFor(Acc
         }
 
         MaybeNotifyOfValueChange(aRelProvider);
         FireDelayedEvent(reorderEvent);
 
         // Reinserted previously ARIA owned elements into the tree
         // (restore a DOM-like order).
         for (uint32_t idx = 0; idx < containers.Length(); idx++) {
-          if (containers[idx]->IsInDocument()) {
+          Accessible* container = containers[idx];
+          MOZ_ASSERT(container, "Cannot be a null");
+          if (container && containers[idx]->IsInDocument()) {
             UpdateTreeOnInsertion(containers[idx]);
           }
         }
       }
     }
 
     // If the relation attribute is given then we don't have anything else to
     // check.