From 0fa63b69a3dbd6fc77e1cf438f9755bfc17ac043 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Mon, 28 May 2007 02:20:58 +0000 Subject: [PATCH] Not part of the build. Don't trim whitespace if wrapping is disabled. Don't compress a space that's preceded by an incompressible space. git-svn-id: svn://10.0.0.236/trunk@227093 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsTextFrameThebes.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/generic/nsTextFrameThebes.cpp b/mozilla/layout/generic/nsTextFrameThebes.cpp index 00490b19b49..d629b3e0946 100644 --- a/mozilla/layout/generic/nsTextFrameThebes.cpp +++ b/mozilla/layout/generic/nsTextFrameThebes.cpp @@ -1398,6 +1398,11 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer) aTextBuffer = end; } } + // In CSS 2.1, we do not compress a space that is preceded by a non-compressible + // space. + if (!compressWhitespace) { + mTrimNextRunLeadingWhitespace = PR_FALSE; + } textFlags |= analysisFlags; currentTransformedTextOffset = @@ -4899,7 +4904,8 @@ nsTextFrame::Reflow(nsPresContext* aPresContext, PRBool usedHyphenation; gfxFloat trimmedWidth = 0; gfxFloat availWidth = aReflowState.availableWidth; - PRBool canTrimTrailingWhitespace = !textStyle->WhiteSpaceIsSignificant(); + PRBool canTrimTrailingWhitespace = !textStyle->WhiteSpaceIsSignificant() && + textStyle->WhiteSpaceCanWrap(); PRUint32 transformedCharsFit = mTextRun->BreakAndMeasureText(transformedOffset, transformedLength, (GetStateBits() & TEXT_START_OF_LINE) != 0,