From dac3d16a14174d1b4f008dcf3823bc0bb87e8248 Mon Sep 17 00:00:00 2001 From: "bzbarsky@mit.edu" Date: Wed, 7 Nov 2007 09:17:30 -0800 Subject: [PATCH] If we moved but did not reflow either the caption or the inner table, invalidate the relevant area. Bug 379353, r=bernd, sr=roc --- layout/tables/nsTableOuterFrame.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp index 4454e9c143e0..a5c9f3c0b1e1 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -1278,9 +1278,12 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext, FinishReflowChild(mCaptionFrame, aPresContext, captionRS, captionMet, captionOrigin.x, captionOrigin.y, 0); captionRS->~nsHTMLReflowState(); - } else { + } else if (mCaptionFrame->GetPosition() != captionOrigin) { + // Invalidate both the old and new rects + mCaptionFrame->Invalidate(mCaptionFrame->GetOverflowRect()); mCaptionFrame->SetPosition(captionOrigin); nsTableFrame::RePositionViews(mCaptionFrame); + mCaptionFrame->Invalidate(mCaptionFrame->GetOverflowRect()); } } // XXX If the height is constrained then we need to check whether @@ -1295,9 +1298,12 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext, FinishReflowChild(mInnerTableFrame, aPresContext, innerRS, innerMet, innerOrigin.x, innerOrigin.y, 0); innerRS->~nsHTMLReflowState(); - } else { + } else if (mInnerTableFrame->GetPosition() != innerOrigin) { + // Invalidate both the old and new rects + mInnerTableFrame->Invalidate(mInnerTableFrame->GetOverflowRect()); mInnerTableFrame->SetPosition(innerOrigin); nsTableFrame::RePositionViews(mInnerTableFrame); + mInnerTableFrame->Invalidate(mInnerTableFrame->GetOverflowRect()); } UpdateReflowMetrics(captionSide, aDesiredSize, innerMargin, captionMargin);