diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 33bcafda658..83bd073fccb 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -2619,7 +2619,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo if (pfd->GetFlag(PFD_RECOMPUTEOVERFLOW) || frame->GetStyleContext()->HasTextDecorationLines()) { nsTextFrame* f = static_cast(frame); - r = f->RecomputeOverflow(); + r = f->RecomputeOverflow(*mBlockReflowState); } frame->FinishAndStoreOverflow(r, frame->GetSize()); } diff --git a/layout/generic/nsLineLayout.h b/layout/generic/nsLineLayout.h index 91eb19a61e3..9a42d97d893 100644 --- a/layout/generic/nsLineLayout.h +++ b/layout/generic/nsLineLayout.h @@ -369,6 +369,9 @@ public: * context (e.g. MathML or floating first-letter). */ nsIFrame* GetLineContainerFrame() const { return mBlockReflowState->frame; } + const nsHTMLReflowState* GetLineContainerRS() const { + return mBlockReflowState; + } const nsLineList::iterator* GetLine() const { return GetFlag(LL_GOTLINEBOX) ? &mLineBox : nsnull; } diff --git a/layout/generic/nsTextFrame.h b/layout/generic/nsTextFrame.h index d522ffcc8ae..ad18f1ccb3c 100644 --- a/layout/generic/nsTextFrame.h +++ b/layout/generic/nsTextFrame.h @@ -264,7 +264,8 @@ public: PRUint32 aSkippedStartOffset = 0, PRUint32 aSkippedMaxLength = PR_UINT32_MAX); - nsOverflowAreas RecomputeOverflow(); + nsOverflowAreas + RecomputeOverflow(const nsHTMLReflowState& aBlockReflowState); void AddInlineMinWidthForFlow(nsRenderingContext *aRenderingContext, nsIFrame::InlineMinWidthData *aData); @@ -434,6 +435,7 @@ protected: SelectionDetails* GetSelectionDetails(); void UnionAdditionalOverflow(nsPresContext* aPresContext, + const nsHTMLReflowState& aBlockReflowState, PropertyProvider& aProvider, nsRect* aVisualOverflowRect, bool aIncludeTextDecorations); diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 9c6970e781e..566713f5c16 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -4375,6 +4375,7 @@ nsTextFrame::GetTextDecorations(nsPresContext* aPresContext, void nsTextFrame::UnionAdditionalOverflow(nsPresContext* aPresContext, + const nsHTMLReflowState& aBlockReflowState, PropertyProvider& aProvider, nsRect* aVisualOverflowRect, bool aIncludeTextDecorations) @@ -7306,8 +7307,8 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth, // When we have text decorations, we don't need to compute their overflow now // because we're guaranteed to do it later // (see nsLineLayout::RelativePositionFrames) - UnionAdditionalOverflow(presContext, provider, &aMetrics.VisualOverflow(), - false); + UnionAdditionalOverflow(presContext, *aLineLayout.GetLineContainerRS(), + provider, &aMetrics.VisualOverflow(), false); ///////////////////////////////////////////////////////////////////// // Clean up, update state @@ -7544,7 +7545,7 @@ nsTextFrame::TrimTrailingWhiteSpace(nsRenderingContext* aRC) } nsOverflowAreas -nsTextFrame::RecomputeOverflow() +nsTextFrame::RecomputeOverflow(const nsHTMLReflowState& aBlockReflowState) { nsRect bounds(nsPoint(0, 0), GetSize()); nsOverflowAreas result(bounds, bounds); @@ -7563,7 +7564,8 @@ nsTextFrame::RecomputeOverflow() &provider); nsRect &vis = result.VisualOverflow(); vis.UnionRect(vis, RoundOut(textMetrics.mBoundingBox) + nsPoint(0, mAscent)); - UnionAdditionalOverflow(PresContext(), provider, &vis, true); + UnionAdditionalOverflow(PresContext(), aBlockReflowState, provider, + &vis, true); return result; } static PRUnichar TransformChar(const nsStyleText* aStyle, gfxTextRun* aTextRun,