Bug 876092. Copy the DisplayItemClip into OutOfFlowDisplayData instead of storing a pointer. r=mats

This commit is contained in:
Robert O'Callahan 2013-06-18 21:15:39 +12:00
parent 784c573287
commit f3277d1b19
3 changed files with 10 additions and 5 deletions

View File

@ -598,8 +598,10 @@ void nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
if (!dirty.IntersectRect(dirty, overflowRect))
return;
aFrame->Properties().Set(nsDisplayListBuilder::OutOfFlowDisplayDataProperty(),
new OutOfFlowDisplayData(mClipState.GetClipForContainingBlockDescendants(), dirty));
const DisplayItemClip* clip = mClipState.GetClipForContainingBlockDescendants();
OutOfFlowDisplayData* data = clip ? new OutOfFlowDisplayData(*clip, dirty)
: new OutOfFlowDisplayData(dirty);
aFrame->Properties().Set(nsDisplayListBuilder::OutOfFlowDisplayDataProperty(), data);
MarkFrameForDisplay(aFrame, aDirtyFrame);
}

View File

@ -574,12 +574,15 @@ public:
void SetCurrentTableItem(nsDisplayTableItem* aTableItem) { mCurrentTableItem = aTableItem; }
struct OutOfFlowDisplayData {
OutOfFlowDisplayData(const DisplayItemClip* aContainingBlockClip,
OutOfFlowDisplayData(const DisplayItemClip& aContainingBlockClip,
const nsRect &aDirtyRect)
: mContainingBlockClip(aContainingBlockClip)
, mDirtyRect(aDirtyRect)
{}
const DisplayItemClip* mContainingBlockClip;
OutOfFlowDisplayData(const nsRect &aDirtyRect)
: mDirtyRect(aDirtyRect)
{}
DisplayItemClip mContainingBlockClip;
nsRect mDirtyRect;
};
static void DestroyOutOfFlowDisplayData(void* aPropertyValue)

View File

@ -2107,7 +2107,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
if (savedOutOfFlowData) {
clipState.SetClipForContainingBlockDescendants(
savedOutOfFlowData->mContainingBlockClip);
&savedOutOfFlowData->mContainingBlockClip);
}
// Setup clipping for the parent's overflow:-moz-hidden-unscrollable,