diff --git a/accessible/src/base/nsARIAMap.cpp b/accessible/src/base/nsARIAMap.cpp index 57c5cae3946..905d6966193 100644 --- a/accessible/src/base/nsARIAMap.cpp +++ b/accessible/src/base/nsARIAMap.cpp @@ -61,7 +61,7 @@ static const nsStateMapEntry kEndEntry = {0, 0, 0}; // To fill in array of stat nsRoleMapEntry nsARIAMap::gWAIRoleMap[] = { - {"alert", nsIAccessibleRole::ROLE_ALERT, eNameOkFromChildren, eNoValue, kNoReqStates, kEndEntry}, + {"alert", nsIAccessibleRole::ROLE_ALERT, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry}, {"alertdialog", nsIAccessibleRole::ROLE_ALERT, eNameOkFromChildren, eNoValue, kNoReqStates, kEndEntry}, {"application", nsIAccessibleRole::ROLE_APPLICATION, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry}, {"button", nsIAccessibleRole::ROLE_PUSHBUTTON, eNameOkFromChildren, eNoValue, kNoReqStates, diff --git a/accessible/src/xul/nsXULAlertAccessible.cpp b/accessible/src/xul/nsXULAlertAccessible.cpp index ead428c9fac..40d5cda9551 100644 --- a/accessible/src/xul/nsXULAlertAccessible.cpp +++ b/accessible/src/xul/nsXULAlertAccessible.cpp @@ -64,46 +64,3 @@ nsXULAlertAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState) return NS_OK; } -#if 0 -// We don't need this, but the AT will need to read all of the alert's children -// when it receives EVENT_ALERT on a ROLE_ALERT -NS_IMETHODIMP nsXULAlertAccessible::GetName(nsAString &aName) -{ - nsCOMPtr presShell(do_QueryReferent(mWeakShell)); - if (!presShell) { - return NS_ERROR_FAILURE; // Node already shut down - } - nsCOMPtr content(do_QueryInterface(mDOMNode)); - NS_ASSERTION(content, "Should not be null if we still have a presShell"); - - nsCOMPtr siblingList; - // returns null if no anon nodes - presShell->GetDocument()->GetXBLChildNodesFor(content, - getter_AddRefs(siblingList)); - if (siblingList) { - PRUint32 length, count; - siblingList->GetLength(&length); - for (count = 0; count < length; count ++) { - nsCOMPtr domNode; - siblingList->Item(count, getter_AddRefs(domNode)); - nsCOMPtr labeledEl(do_QueryInterface(domNode)); - if (labeledEl) { - nsAutoString label; - labeledEl->GetLabel(label); - aName += NS_LITERAL_STRING(" ") + label + NS_LITERAL_STRING(" "); - } - else { - nsCOMPtr content(do_QueryInterface(domNode)); - if (content) { - AppendFlatStringFromSubtree(content, &aName); - } - } - } - } - else { - AppendFlatStringFromSubtree(content, &aName); - } - - return NS_OK; -} -#endif