From 85af4870f33f8be2a2899dec30af8a21006e2774 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Wed, 31 Aug 2016 16:14:30 -0400 Subject: [PATCH] bug 1316789 - UncacheChildren should not go between documents r=davidb --- accessible/generic/DocAccessible.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/accessible/generic/DocAccessible.cpp b/accessible/generic/DocAccessible.cpp index ad930bb627a8..0747ba105594 100644 --- a/accessible/generic/DocAccessible.cpp +++ b/accessible/generic/DocAccessible.cpp @@ -2273,8 +2273,15 @@ DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot) RemoveDependentIDsFor(aRoot); uint32_t count = aRoot->ContentChildCount(); - for (uint32_t idx = 0; idx < count; idx++) - UncacheChildrenInSubtree(aRoot->ContentChildAt(idx)); + for (uint32_t idx = 0; idx < count; idx++) { + Accessible* child = aRoot->ContentChildAt(idx); + + // Removing this accessible from the document doesn't mean anything about + // accessibles for subdocuments, so skip removing those from the tree. + if (!child->IsDoc()) { + UncacheChildrenInSubtree(child); + } + } if (aRoot->IsNodeMapEntry() && mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)