Bug 545049. Capture the pre-transform overflow area of a frame and use it in InvalidateOverflowArea. r=mats

This commit is contained in:
Robert O'Callahan 2010-03-29 14:46:58 +13:00
parent 93d285f634
commit a27c78da5a
5 changed files with 16 additions and 13 deletions

View file

@ -7211,7 +7211,7 @@ DoApplyRenderingChangeToTree(nsIFrame* aFrame,
} }
#endif #endif
} else { } else {
aFrame->Invalidate(aFrame->GetOverflowRect()); aFrame->InvalidateOverflowRect();
} }
} }
} }
@ -7303,7 +7303,7 @@ InvalidateCanvasIfNeeded(nsIPresShell* presShell, nsIContent* node)
nsIViewManager::UpdateViewBatch batch(presShell->GetViewManager()); nsIViewManager::UpdateViewBatch batch(presShell->GetViewManager());
nsIFrame* rootFrame = presShell->GetRootFrame(); nsIFrame* rootFrame = presShell->GetRootFrame();
rootFrame->Invalidate(rootFrame->GetOverflowRect()); rootFrame->InvalidateOverflowRect();
batch.EndUpdateViewBatch(NS_VMREFRESH_DEFERRED); batch.EndUpdateViewBatch(NS_VMREFRESH_DEFERRED);
} }

View file

@ -534,7 +534,7 @@ nsFrameManager::RemoveFrame(nsIAtom* aListName,
// that doesn't change the size of the parent.) // that doesn't change the size of the parent.)
// This has to sure to invalidate the entire overflow rect; this // This has to sure to invalidate the entire overflow rect; this
// is important in the presence of absolute positioning // is important in the presence of absolute positioning
aOldFrame->Invalidate(aOldFrame->GetOverflowRect()); aOldFrame->InvalidateOverflowRect();
NS_ASSERTION(!aOldFrame->GetPrevContinuation() || NS_ASSERTION(!aOldFrame->GetPrevContinuation() ||
// exception for nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames // exception for nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames

View file

@ -1120,7 +1120,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
} }
} }
aNextInFlow->Invalidate(aNextInFlow->GetOverflowRect()); aNextInFlow->InvalidateOverflowRect();
// Take the next-in-flow out of the parent's child list // Take the next-in-flow out of the parent's child list
#ifdef DEBUG #ifdef DEBUG

View file

@ -3825,7 +3825,7 @@ nsIFrame::InvalidateRectDifference(const nsRect& aR1, const nsRect& aR2)
void void
nsIFrame::InvalidateOverflowRect() nsIFrame::InvalidateOverflowRect()
{ {
Invalidate(GetOverflowRect()); Invalidate(GetOverflowRectRelativeToSelf());
} }
void void
@ -3965,14 +3965,14 @@ nsIFrame::GetOverflowRectRelativeToParent() const
nsRect nsRect
nsIFrame::GetOverflowRectRelativeToSelf() const nsIFrame::GetOverflowRectRelativeToSelf() const
{ {
if (!(mState & NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS) || if ((mState & NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS) &&
!GetStyleDisplay()->HasTransform()) GetStyleDisplay()->HasTransform()) {
nsRect* preTransformBBox = static_cast<nsRect*>
(Properties().Get(PreTransformBBoxProperty()));
if (preTransformBBox)
return *preTransformBBox;
}
return GetOverflowRect(); return GetOverflowRect();
nsRect* preEffectsBBox = static_cast<nsRect*>
(Properties().Get(PreEffectsBBoxProperty()));
if (!preEffectsBBox)
return GetOverflowRect();
return *preEffectsBBox;
} }
void void
@ -5666,6 +5666,8 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
(mState & NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS) && (mState & NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS) &&
GetStyleDisplay()->HasTransform(); GetStyleDisplay()->HasTransform();
if (hasTransform) { if (hasTransform) {
Properties().
Set(nsIFrame::PreTransformBBoxProperty(), new nsRect(*aOverflowArea));
/* Since our size might not actually have been computed yet, we need to make sure that we use the /* Since our size might not actually have been computed yet, we need to make sure that we use the
* correct dimensions by overriding the stored bounding rectangle with the value the caller has * correct dimensions by overriding the stored bounding rectangle with the value the caller has
* ensured us we'll use. * ensured us we'll use.

View file

@ -831,6 +831,7 @@ public:
NS_DECLARE_FRAME_PROPERTY(OutlineInnerRectProperty, DestroyRect) NS_DECLARE_FRAME_PROPERTY(OutlineInnerRectProperty, DestroyRect)
NS_DECLARE_FRAME_PROPERTY(PreEffectsBBoxProperty, DestroyRect) NS_DECLARE_FRAME_PROPERTY(PreEffectsBBoxProperty, DestroyRect)
NS_DECLARE_FRAME_PROPERTY(PreTransformBBoxProperty, DestroyRect)
NS_DECLARE_FRAME_PROPERTY(UsedMarginProperty, DestroyMargin) NS_DECLARE_FRAME_PROPERTY(UsedMarginProperty, DestroyMargin)
NS_DECLARE_FRAME_PROPERTY(UsedPaddingProperty, DestroyMargin) NS_DECLARE_FRAME_PROPERTY(UsedPaddingProperty, DestroyMargin)