bool DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID) { if (mShutdown) return true; 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!"); return true; } ProxyAccessible* root = rootEntry->mProxy; if (!root) { NS_ERROR("invalid root being removed!"); return true; } ProxyAccessible* parent = root->Parent(); parent->RemoveChild(root); root->Shutdown(); MOZ_DIAGNOSTIC_ASSERT(CheckDocTree()); return true; }
bool DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID, const bool& aFromUser) { if (mShutdown) return true; 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!"); return true; } ProxyAccessible* root = rootEntry->mProxy; if (!root) { NS_ERROR("invalid root being removed!"); return true; } ProxyAccessible* parent = root->Parent(); ProxyShowHideEvent(root, parent, false, aFromUser); RefPtr<xpcAccHideEvent> event = nullptr; if (nsCoreUtils::AccEventObserversExist()) { uint32_t type = nsIAccessibleEvent::EVENT_HIDE; xpcAccessibleGeneric* xpcAcc = GetXPCAccessible(root); xpcAccessibleGeneric* xpcParent = GetXPCAccessible(parent); ProxyAccessible* next = root->NextSibling(); xpcAccessibleGeneric* xpcNext = next ? GetXPCAccessible(next) : nullptr; ProxyAccessible* prev = root->PrevSibling(); xpcAccessibleGeneric* xpcPrev = prev ? GetXPCAccessible(prev) : nullptr; xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this); nsIDOMNode* node = nullptr; event = new xpcAccHideEvent(type, xpcAcc, doc, node, aFromUser, xpcParent, xpcNext, xpcPrev); } parent->RemoveChild(root); root->Shutdown(); MOZ_DIAGNOSTIC_ASSERT(CheckDocTree()); if (event) { nsCoreUtils::DispatchAccEvent(Move(event)); } return true; }
bool DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID) { ProxyEntry* rootEntry = mAccessibles.GetEntry(aRootID); if (!rootEntry) { NS_ERROR("invalid root being removed!"); return true; } ProxyAccessible* root = rootEntry->mProxy; if (!root) { NS_ERROR("invalid root being removed!"); return true; } ProxyAccessible* parent = root->Parent(); parent->RemoveChild(root); root->Shutdown(); return true; }