diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index 91a88aac01f..3360baabb93 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -1482,8 +1482,10 @@ nsLineLayout::PlaceFrame(PerFrameData* pfd, nsHTMLReflowMetrics& aMetrics) SetFlag(LL_ENDSINWHITESPACE, PR_FALSE); } - // Count the number of frames on the line... - mTotalPlacedFrames++; + // Count the number of non-empty frames on the line... + if (!emptyFrame) { + mTotalPlacedFrames++; + } if (psd->mX != psd->mLeftEdge || pfd->mBounds.x != psd->mLeftEdge) { // As soon as a frame placed on the line advances an X coordinate // of any span we can no longer place a float on the line. diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index de9fdd50702..a5cd8a6cb9a 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -4584,7 +4584,7 @@ nsTextFrame::MeasureText(nsPresContext* aPresContext, aTs.mNormalFont->GetMaxDescent(aTextData.mDescent); } PRBool firstWordDone = PR_FALSE; - for (;;firstThing = PR_FALSE) { + for (;;) { #ifdef IBMBIDI if (nextBidi && (mContentLength <= 0) ) { if (textRun.IsBuffering()) { @@ -4690,6 +4690,7 @@ nsTextFrame::MeasureText(nsPresContext* aPresContext, mState |= TEXT_SKIP_LEADING_WS; continue; } + firstThing = PR_FALSE; // NOTE: Even if the textRun absorbs the whitespace below, we still // want to remember that we're breakable. @@ -4746,6 +4747,7 @@ nsTextFrame::MeasureText(nsPresContext* aPresContext, } //(aTextData.mMeasureText) } else { + firstThing = PR_FALSE; aTextData.mSkipWhitespace = PR_FALSE; if (aTextData.mFirstLetterOK) { diff --git a/mozilla/layout/html/base/src/nsLineLayout.cpp b/mozilla/layout/html/base/src/nsLineLayout.cpp index 91a88aac01f..3360baabb93 100644 --- a/mozilla/layout/html/base/src/nsLineLayout.cpp +++ b/mozilla/layout/html/base/src/nsLineLayout.cpp @@ -1482,8 +1482,10 @@ nsLineLayout::PlaceFrame(PerFrameData* pfd, nsHTMLReflowMetrics& aMetrics) SetFlag(LL_ENDSINWHITESPACE, PR_FALSE); } - // Count the number of frames on the line... - mTotalPlacedFrames++; + // Count the number of non-empty frames on the line... + if (!emptyFrame) { + mTotalPlacedFrames++; + } if (psd->mX != psd->mLeftEdge || pfd->mBounds.x != psd->mLeftEdge) { // As soon as a frame placed on the line advances an X coordinate // of any span we can no longer place a float on the line. diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index de9fdd50702..a5cd8a6cb9a 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -4584,7 +4584,7 @@ nsTextFrame::MeasureText(nsPresContext* aPresContext, aTs.mNormalFont->GetMaxDescent(aTextData.mDescent); } PRBool firstWordDone = PR_FALSE; - for (;;firstThing = PR_FALSE) { + for (;;) { #ifdef IBMBIDI if (nextBidi && (mContentLength <= 0) ) { if (textRun.IsBuffering()) { @@ -4690,6 +4690,7 @@ nsTextFrame::MeasureText(nsPresContext* aPresContext, mState |= TEXT_SKIP_LEADING_WS; continue; } + firstThing = PR_FALSE; // NOTE: Even if the textRun absorbs the whitespace below, we still // want to remember that we're breakable. @@ -4746,6 +4747,7 @@ nsTextFrame::MeasureText(nsPresContext* aPresContext, } //(aTextData.mMeasureText) } else { + firstThing = PR_FALSE; aTextData.mSkipWhitespace = PR_FALSE; if (aTextData.mFirstLetterOK) {