From c4ec56a8b44d7e72361761664ced537594e5ea81 Mon Sep 17 00:00:00 2001 From: "sharparrow1%yahoo.com" Date: Tue, 28 Aug 2007 01:35:59 +0000 Subject: [PATCH] Bug 389224: Clipped objects are sometimes not fully redrawn after clipping. r+sr=roc, a=dbaron --- layout/generic/nsAbsoluteContainingBlock.cpp | 8 ++++---- layout/style/nsStyleStruct.cpp | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp index 41499052a26..35b0a02564b 100644 --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -423,12 +423,12 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat if (oldRect.TopLeft() != rect.TopLeft() || (aDelegatingFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) || - ((aKidFrame->GetStyleDisplay()->mClipFlags & NS_STYLE_CLIP_RECT) && - (kidDesiredSize.mOverflowArea != oldOverflowRect))) { + (kidDesiredSize.mOverflowArea + rect.TopLeft() != oldOverflowRect && + (kidDesiredSize.mOverflowArea + rect.TopLeft() != rect || oldRect != oldOverflowRect))) { // The frame moved; we have to invalidate the whole frame // because the children may have moved after they were reflowed - // We also have to invalidate when we're clipping and the overflow - // changes; the style code doesn't know how to deal with this case + // We also have to invalidate when we have overflow and the overflow + // changes because the change might be caused by clipping // XXX This could be optimized in some cases, especially clipping changes aKidFrame->GetParent()->Invalidate(oldOverflowRect); aKidFrame->GetParent()->Invalidate(kidDesiredSize.mOverflowArea + diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index f0fbdbcebd0..133b634a569 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -1169,11 +1169,6 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const if (mClipFlags != aOther.mClipFlags || mClip != aOther.mClip) { NS_UpdateHint(hint, nsChangeHint_ReflowFrame); - // The reflow code in naAbsoluteContainingBlock can deal with invalidation - // in all cases except changing from non-auto clip to auto clip; when - // changing to auto clip, the frame can't tell what happened - if (mClipFlags == NS_STYLE_CLIP_AUTO) - NS_UpdateHint(hint, nsChangeHint_RepaintFrame); } // XXX the following is conservative, for now: changing float breaking shouldn't // necessarily require a repaint, reflow should suffice.