Bug 1145724 - adding null check before creating treewalker in nsAccessibilityService::ContentRemoved r=surkov
authorYura Zenevich <yzenevich@mozilla.com>
Thu, 26 Mar 2015 14:59:16 -0400
changeset 264826 3f5c7e485c60a9834c53c82178b733cdaadf9524
parent 264825 fbbe7bf4392999f3817557d7ce83cf44d5638555
child 264827 97134d07092a8aa76c12fc2cbbb2ed601094e049
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1145724
milestone39.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 1145724 - adding null check before creating treewalker in nsAccessibilityService::ContentRemoved r=surkov --- accessible/base/nsAccessibilityService.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
accessible/base/nsAccessibilityService.cpp
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -528,18 +528,19 @@ nsAccessibilityService::ContentRemoved(n
   DocAccessible* document = GetDocAccessible(aPresShell);
   if (document) {
     // Flatten hierarchy may be broken at this point so we cannot get a true
     // container by traversing up the DOM tree. Find a parent of first accessible
     // from the subtree of the given DOM node, that'll be a container. If no
     // accessibles in subtree then we don't care about the change.
     Accessible* child = document->GetAccessible(aChildNode);
     if (!child) {
-      a11y::TreeWalker walker(document->GetContainerAccessible(aChildNode),
-                              aChildNode, a11y::TreeWalker::eWalkCache);
+      Accessible* container = document->GetContainerAccessible(aChildNode);
+      a11y::TreeWalker walker(container ? container : document, aChildNode,
+                              a11y::TreeWalker::eWalkCache);
       child = walker.NextChild();
     }
 
     if (child) {
       document->ContentRemoved(child->Parent(), aChildNode);
 #ifdef A11Y_LOG
       if (logging::IsEnabled(logging::eTree))
         logging::AccessibleNNode("real container", child->Parent());