Bug 298972. Don't trim out whitespace in the name of accessible text objects. r=parente, sr=neil, a=mkaply

This commit is contained in:
aaronleventhal%moonset.net 2005-06-28 16:57:41 +00:00
parent 6ff0f9e270
commit 7df51c1fae

View File

@ -54,13 +54,18 @@ nsTextAccessibleWrap(aDomNode, aShell), mFrame(aFrame)
}
NS_IMETHODIMP nsHTMLTextAccessible::GetName(nsAString& aName)
{
nsAutoString accName;
if (NS_FAILED(mDOMNode->GetNodeValue(accName)))
{
aName.Truncate();
if (!mDOMNode) {
return NS_ERROR_FAILURE;
accName.CompressWhitespace();
aName = accName;
return NS_OK;
}
nsAutoString name;
nsresult rv = mDOMNode->GetNodeValue(name);
if (NS_SUCCEEDED(rv)) {
name.ReplaceChar("\r\n\t", ' ');
aName = name;
}
return rv;
}
nsIFrame* nsHTMLTextAccessible::GetFrame()