From 01ebf6856f061cc76a87e9d4a388d6bcfdbb1181 Mon Sep 17 00:00:00 2001 From: "uriber%gmail.com" Date: Mon, 3 Jul 2006 07:12:42 +0000 Subject: [PATCH] Limit the fix for bug 337135 to the -moz-pre-wrap case only. bug=343390, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@201480 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsTextFrame.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 3dade64470d..d0da3ec7daf 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -2919,9 +2919,15 @@ nsTextFrame::PaintUnicodeText(nsPresContext* aPresContext, nsTextTransformer tx(aPresContext); PRInt32 textLength; + + // In whitespace:-moz-pre-wrap it's possible that we trimmed multiple + // spaces from the end of line because they did not fit in the line. + // In that case, all those spaces need to be removed before painting. + PRBool removeMultipleTrimmedWS = NS_STYLE_WHITESPACE_MOZ_PRE_WRAP == GetStyleText()->mWhiteSpace; + // no need to worry about justification, that's always on the slow path PrepareUnicodeText(tx, (displaySelection ? &indexBuffer : nsnull), - &paintBuffer, &textLength, PR_FALSE, nsnull, PR_TRUE); + &paintBuffer, &textLength, PR_FALSE, nsnull, removeMultipleTrimmedWS); PRInt32* ip = indexBuffer.mBuffer; PRUnichar* text = paintBuffer.mBuffer;