summaryrefslogtreecommitdiff
path: root/layout/generic/nsPageFrame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/generic/nsPageFrame.cpp')
-rw-r--r--layout/generic/nsPageFrame.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp
index ae3af6ef77..7ec90c051b 100644
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -437,7 +437,7 @@ PruneDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
static void
BuildDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
nsPageFrame* aPage, nsIFrame* aExtraPage,
- const nsRect& aDirtyRect, nsDisplayList* aList)
+ nsDisplayList* aList)
{
// The only content in aExtraPage we care about is out-of-flow content whose
// placeholders have occurred in aPage. If
@@ -447,7 +447,7 @@ BuildDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
return;
}
nsDisplayList list;
- aExtraPage->BuildDisplayListForStackingContext(aBuilder, aDirtyRect, &list);
+ aExtraPage->BuildDisplayListForStackingContext(aBuilder, &list);
PruneDisplayListForExtraPage(aBuilder, aPage, aExtraPage, &list);
aList->AppendToTop(&list);
}
@@ -517,10 +517,9 @@ protected:
//------------------------------------------------------------------------------
void
nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
- const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
- nsDisplayListCollection set;
+ nsDisplayListCollection set(aBuilder);
if (PresContext()->IsScreen()) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
@@ -557,8 +556,11 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
clipState.Clear();
clipState.ClipContainingBlockDescendants(clipRect, nullptr);
- nsRect dirtyRect = child->GetVisualOverflowRectRelativeToSelf();
- child->BuildDisplayListForStackingContext(aBuilder, dirtyRect, &content);
+ nsRect visibleRect = child->GetVisualOverflowRectRelativeToSelf();
+ nsDisplayListBuilder::AutoBuildingDisplayList
+ buildingForChild(aBuilder, child, visibleRect, visibleRect,
+ aBuilder->IsAtRootOfPseudoStackingContext());
+ child->BuildDisplayListForStackingContext(aBuilder, &content);
// We may need to paint out-of-flow frames whose placeholders are
// on other pages. Add those pages to our display list. Note that
@@ -569,15 +571,19 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// following placeholders to their out-of-flows) end up on the list.
nsIFrame* page = child;
while ((page = GetNextPage(page)) != nullptr) {
- BuildDisplayListForExtraPage(aBuilder, this, page,
- dirtyRect + child->GetOffsetTo(page), &content);
+ nsRect childVisible = visibleRect + child->GetOffsetTo(page);
+
+ nsDisplayListBuilder::AutoBuildingDisplayList
+ buildingForChild(aBuilder, page, childVisible, childVisible,
+ aBuilder->IsAtRootOfPseudoStackingContext());
+ BuildDisplayListForExtraPage(aBuilder, this, page, &content);
}
- // Invoke AutoBuildingDisplayList to ensure that the correct dirtyRect
+ // Invoke AutoBuildingDisplayList to ensure that the correct visibleRect
// is used to compute the visible rect if AddCanvasBackgroundColorItem
// creates a display item.
nsDisplayListBuilder::AutoBuildingDisplayList
- building(aBuilder, child, dirtyRect, true);
+ building(aBuilder, child, visibleRect, visibleRect, true);
// Add the canvas background color to the bottom of the list. This
// happens after we've built the list so that AddCanvasBackgroundColorItem