Bug 407227. Include end-of-linebreaker-textrun break opportunity in min-width calculation. r+sr=dbaron,a=schrep

This commit is contained in:
roc+@cs.cmu.edu 2007-12-06 19:27:01 -08:00
parent 079aadfbec
commit deaf474141

View File

@ -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;