From 79d461a5dd046a401fbe35530253bf763c16fe6a Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 7 Nov 2007 17:17:30 +0000 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 4454e9c143e..a5c9f3c0b1e 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);