bug 1204070 - add a little more checking to proxy subtree removal r=davidb

This commit is contained in:
Trevor Saunders 2015-09-11 15:22:51 -04:00
parent 2348cd28d0
commit 2d06b997a3
3 changed files with 9 additions and 1 deletions

View File

@ -106,6 +106,13 @@ DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID)
MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
// We shouldn't actually need this because mAccessibles shouldn't have an
// entry for the document itself, but it doesn't hurt to be explicit.
if (!aRootID) {
NS_ERROR("trying to hide entire document?");
return false;
}
ProxyEntry* rootEntry = mAccessibles.GetEntry(aRootID);
if (!rootEntry) {
NS_ERROR("invalid root being removed!");

View File

@ -104,7 +104,7 @@ public:
void RemoveAccessible(ProxyAccessible* aAccessible)
{
MOZ_ASSERT(mAccessibles.GetEntry(aAccessible->ID()));
MOZ_DIAGNOSTIC_ASSERT(mAccessibles.GetEntry(aAccessible->ID()));
mAccessibles.RemoveEntry(aAccessible->ID());
}

View File

@ -21,6 +21,7 @@ namespace a11y {
void
ProxyAccessible::Shutdown()
{
MOZ_DIAGNOSTIC_ASSERT(!IsDoc());
NS_ASSERTION(!mOuterDoc, "Why do we still have a child doc?");
// XXX Ideally this wouldn't be necessary, but it seems OuterDoc accessibles