#77394 incorrect handling of empty text nodes

r=waterson, sr=attinasi
This commit is contained in:
shanjian%netscape.com 2001-07-09 20:47:58 +00:00
parent 4d9cf22b70
commit 49936baba8
2 changed files with 18 additions and 2 deletions

View File

@ -5381,7 +5381,15 @@ nsTextFrame::ComputeWordFragmentWidth(nsIPresContext* aPresContext,
PRBool isWhitespace, wasTransformed;
PRInt32 wordLen, contentLen;
PRUnichar* bp = tx.GetNextWord(PR_TRUE, &wordLen, &contentLen, &isWhitespace, &wasTransformed);
if (!bp || isWhitespace) {
if (!bp) {
//empty text node, but we need to continue lookahead measurement
// AND we need to remember the text frame for later so that we don't
// bother doing the word look ahead.
aLineLayout.RecordWordFrame(aTextFrame);
return 0;
}
if (isWhitespace) {
// Don't bother measuring nothing
*aStop = PR_TRUE;
return 0;

View File

@ -5381,7 +5381,15 @@ nsTextFrame::ComputeWordFragmentWidth(nsIPresContext* aPresContext,
PRBool isWhitespace, wasTransformed;
PRInt32 wordLen, contentLen;
PRUnichar* bp = tx.GetNextWord(PR_TRUE, &wordLen, &contentLen, &isWhitespace, &wasTransformed);
if (!bp || isWhitespace) {
if (!bp) {
//empty text node, but we need to continue lookahead measurement
// AND we need to remember the text frame for later so that we don't
// bother doing the word look ahead.
aLineLayout.RecordWordFrame(aTextFrame);
return 0;
}
if (isWhitespace) {
// Don't bother measuring nothing
*aStop = PR_TRUE;
return 0;