Bug 312747. Include line break info when exposing text in white-space: pre. r=roc, sr=bz

This commit is contained in:
aaronleventhal%moonset.net 2005-10-18 02:35:20 +00:00
Родитель 4a7f4df475
Коммит 0cb3270033
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -59,12 +59,20 @@ NS_IMETHODIMP nsHTMLTextAccessible::GetName(nsAString& aName)
if (!mDOMNode) {
return NS_ERROR_FAILURE;
}
nsIFrame *frame = GetFrame();
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
nsAutoString name;
nsresult rv = mDOMNode->GetNodeValue(name);
if (NS_SUCCEEDED(rv)) {
NS_ENSURE_SUCCESS(rv, rv);
if (!frame->GetStyleText()->WhiteSpaceIsSignificant()) {
// Replace \r\n\t in markup with space unless in this is preformatted text
// where those characters are significant
name.ReplaceChar("\r\n\t", ' ');
aName = name;
}
aName = name;
return rv;
}