From de5a5280866a6663917b013fe64ef08c16be9c1c Mon Sep 17 00:00:00 2001 From: "aaronleventhal@moonset.net" Date: Tue, 4 Dec 2007 21:06:59 -0800 Subject: [PATCH] Bug 406019. EVENT_ALERT and EVENT_MENUPOPUPSTART broken for ARIA widgets. r=evan.yan, a=dsicore --- accessible/src/base/nsDocAccessible.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp index 5d491f92b335..e408b8ee8a1d 100644 --- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -1894,21 +1894,27 @@ NS_IMETHODIMP nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild, eCoalesceFromSameSubtree, isAsynch); // Check to see change occured in an ARIA menu, and fire an EVENT_MENUPOPUP_START if it did - if (ARIARoleEquals(aChild, "menu")) { + nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(childNode); + if (roleMapEntry && roleMapEntry->role == nsIAccessibleRole::ROLE_MENUPOPUP) { FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_START, childNode, nsnull, eAllowDupes, isAsynch); } // Check to see if change occured inside an alert, and fire an EVENT_ALERT if it did nsIContent *ancestor = aChild; - while (ancestor) { - if (ARIARoleEquals(ancestor, "alert")) { + while (PR_TRUE) { + if (roleMapEntry && roleMapEntry->role == nsIAccessibleRole::ROLE_ALERT) { nsCOMPtr alertNode(do_QueryInterface(ancestor)); FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_ALERT, alertNode, nsnull, eRemoveDupes, isAsynch); break; } ancestor = ancestor->GetParent(); + nsCOMPtr ancestorNode = do_QueryInterface(ancestor); + if (!ancestorNode) { + break; + } + roleMapEntry = nsAccUtils::GetRoleMapEntry(ancestorNode); } }