Bug 919144. Part 6: nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay should call IsFixedPosFrameInDisplayPort and make fixed-pos frames intersect their overflow-rect with the viewport's displayport to get their dirty rect. r=mattwoodrow

This prevents insanely large fixed-pos elements from getting an over-huge
dirty rect and building an enormous display list.
This is also a step towards getting rid of nsDisplayListBuilder::mHasDisplayPort,
which is good because the new code works on any subdocument that has a displayport.

--HG--
extra : rebase_source : e853022dd2ce85af318f235f8851d9dd8b5001ac
This commit is contained in:
Robert O'Callahan 2013-09-27 18:01:15 +12:00
parent 5c4d418146
commit c14b5d34af

View File

@ -585,7 +585,14 @@ void nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
nsIFrame* aFrame,
const nsRect& aDirtyRect)
{
nsRect dirty = aDirtyRect - aFrame->GetOffsetTo(aDirtyFrame);
nsRect dirtyRectRelativeToDirtyFrame = aDirtyRect;
nsRect displayPort;
if (nsLayoutUtils::IsFixedPosFrameInDisplayPort(aFrame, &displayPort)) {
NS_ASSERTION(aDirtyFrame == aFrame->GetParent(), "Dirty frame should be viewport frame");
dirtyRectRelativeToDirtyFrame = displayPort;
}
nsRect dirty = dirtyRectRelativeToDirtyFrame - aFrame->GetOffsetTo(aDirtyFrame);
nsRect overflowRect = aFrame->GetVisualOverflowRect();
if (aFrame->IsTransformed() &&
@ -599,10 +606,6 @@ void nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
overflowRect.Inflate(nsPresContext::CSSPixelsToAppUnits(32));
}
if (mHasDisplayPort && IsFixedFrame(aFrame)) {
dirty = overflowRect;
}
if (!dirty.IntersectRect(dirty, overflowRect))
return;
const DisplayItemClip* clip = mClipState.GetClipForContainingBlockDescendants();