Bug 386551 - expose ARIA description on document, r=aaronlev, a=dsicore

This commit is contained in:
surkov.alexander@gmail.com 2007-10-11 23:58:18 -07:00
parent 1bc735eeda
commit b4b1930bd1
2 changed files with 5 additions and 4 deletions

View File

@ -1725,7 +1725,7 @@ nsresult nsAccessible::GetTextFromRelationID(EAriaProperty aIDProperty, nsString
{
// Get DHTML name from content subtree pointed to by ID attribute
aName.Truncate();
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
NS_ASSERTION(content, "Called from shutdown accessible");
nsAutoString ids;
@ -1734,8 +1734,7 @@ nsresult nsAccessible::GetTextFromRelationID(EAriaProperty aIDProperty, nsString
}
ids.CompressWhitespace(PR_TRUE, PR_TRUE);
nsCOMPtr<nsIDOMDocument> domDoc;
mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(content->GetOwnerDoc());
NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);
nsresult rv = NS_ERROR_FAILURE;

View File

@ -224,7 +224,9 @@ NS_IMETHODIMP nsDocAccessible::GetValue(nsAString& aValue)
NS_IMETHODIMP
nsDocAccessible::GetDescription(nsAString& aDescription)
{
aDescription.Truncate();
nsAutoString description;
GetTextFromRelationID(eAria_describedby, description);
aDescription = description;
return NS_OK;
}