diff --git a/mozilla/layout/generic/nsFirstLetterFrame.cpp b/mozilla/layout/generic/nsFirstLetterFrame.cpp index 5fcceba9bed..11ea5fc44ce 100644 --- a/mozilla/layout/generic/nsFirstLetterFrame.cpp +++ b/mozilla/layout/generic/nsFirstLetterFrame.cpp @@ -293,8 +293,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext, ll->BeginSpan(this, &aReflowState, bp.left, availSize.width); ll->ReflowFrame(kid, aReflowStatus, &aMetrics, pushedFrame); - nsSize size; - ll->EndSpan(this, size); + ll->EndSpan(this); } // Place and size the child and update the output metrics diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index 020bdd1d551..e533918ab82 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -536,11 +536,9 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, // line-height calculations. However, continuations of an inline // that are empty we force to empty so that things like collapsed // whitespace in an inline element don't affect the line-height. - nsSize size; - lineLayout->EndSpan(this, size); + aMetrics.width = lineLayout->EndSpan(this); // Compute final width - aMetrics.width = size.width; if (nsnull == GetPrevContinuation()) { aMetrics.width += ltr ? aReflowState.mComputedBorderPadding.left : aReflowState.mComputedBorderPadding.right; diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index ebd4bdc9662..9f402bca916 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -445,8 +445,8 @@ nsLineLayout::BeginSpan(nsIFrame* aFrame, return rv; } -void -nsLineLayout::EndSpan(nsIFrame* aFrame, nsSize& aSizeResult) +nscoord +nsLineLayout::EndSpan(nsIFrame* aFrame) { NS_ASSERTION(mSpanDepth > 0, "end-span without begin-span"); #ifdef NOISY_REFLOW @@ -455,23 +455,12 @@ nsLineLayout::EndSpan(nsIFrame* aFrame, nsSize& aSizeResult) printf(": EndSpan width=%d\n", mCurrentSpan->mX - mCurrentSpan->mLeftEdge); #endif PerSpanData* psd = mCurrentSpan; - nscoord width = 0; - nscoord maxHeight = 0; - if (nsnull != psd->mLastFrame) { - width = psd->mX - psd->mLeftEdge; - PerFrameData* pfd = psd->mFirstFrame; - while (nsnull != pfd) { - if (pfd->mBounds.height > maxHeight) - maxHeight = pfd->mBounds.height; - pfd = pfd->mNext; - } - } - aSizeResult.width = width; - aSizeResult.height = maxHeight; + nscoord widthResult = psd->mLastFrame ? (psd->mX - psd->mLeftEdge) : 0; mSpanDepth--; mCurrentSpan->mReflowState = nsnull; // no longer valid so null it out! mCurrentSpan = mCurrentSpan->mParent; + return widthResult; } PRInt32 diff --git a/mozilla/layout/generic/nsLineLayout.h b/mozilla/layout/generic/nsLineLayout.h index 53ff611408f..6b6855116a3 100644 --- a/mozilla/layout/generic/nsLineLayout.h +++ b/mozilla/layout/generic/nsLineLayout.h @@ -97,7 +97,8 @@ public: nscoord aLeftEdge, nscoord aRightEdge); - void EndSpan(nsIFrame* aFrame, nsSize& aSizeResult); + // Returns the width of the span + nscoord EndSpan(nsIFrame* aFrame); PRInt32 GetCurrentSpanCount() const;