From deaf474141876ebdb8d519757d6dd2593fe89c4d Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Thu, 6 Dec 2007 19:27:01 -0800 Subject: [PATCH] Bug 407227. Include end-of-linebreaker-textrun break opportunity in min-width calculation. r+sr=dbaron,a=schrep --- layout/generic/nsTextFrameThebes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index f899132d28f..a0520d51bac 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -4723,23 +4723,23 @@ nsTextFrame::PeekOffsetWord(PRBool aForward, PRBool aWordSelectEatSpace, PRBool do { PRBool isPunctuation = cIter.IsPunctuation(); - if (aWordSelectEatSpace == cIter.IsWhitespace() && !aState->mSawBeforeType) { + PRBool isWhitespace = cIter.IsWhitespace(); + if (aWordSelectEatSpace == isWhitespace && !aState->mSawBeforeType) { aState->SetSawBeforeType(); - aState->Update(isPunctuation); + aState->Update(isPunctuation, isWhitespace); continue; } // See if we can break before the current cluster if (!aState->mAtStart) { PRBool canBreak = isPunctuation != aState->mLastCharWasPunctuation - ? BreakWordBetweenPunctuation(aForward ? aState->mLastCharWasPunctuation : isPunctuation, - aIsKeyboardSelect) + ? BreakWordBetweenPunctuation(aState, isPunctuation, isWhitespace, aIsKeyboardSelect) : cIter.HaveWordBreakBefore() && aState->mSawBeforeType; if (canBreak) { *aOffset = cIter.GetBeforeOffset() - mContentOffset; return PR_TRUE; } } - aState->Update(isPunctuation); + aState->Update(isPunctuation, isWhitespace); } while (cIter.NextCluster()); *aOffset = cIter.GetAfterOffset() - mContentOffset;