diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2020-02-25 00:17:54 +0200 |
---|---|---|
committer | win7-7 <win7-7@users.noreply.github.com> | 2020-02-25 00:17:54 +0200 |
commit | 44c47c50388f526c2d134e16d5debebe94a0faf8 (patch) | |
tree | 5c46b943a3463f67e379eebdbcc8e364eeca9a7c /layout/generic/nsPageFrame.cpp | |
parent | 81089ff09437ca99eba3dacf901fdef0de533024 (diff) | |
download | uxp-44c47c50388f526c2d134e16d5debebe94a0faf8.tar.gz |
Issue #1355 - Better way to create display items for column backgrounds
Part 1: Remove current table item, as it's never set.
Part 2: Get rid of generic table painting code, and handle each class separately.
Part 4: Hoist outline skipping into col(group) frame code.
Part 5: Skip box-shadow for table column and column groups.
Part 6: Store column and column group backgrounds separately, and then append them before the rest of the table contents.
Part 7: Pass rects in display list coordinates to AppendBackgroundItemsToTop.
Part 8: Create column and column group background display items as part of the cell's BuildDisplayList.
Part 9: Used cached values instead of calling nsDisplayListBuilder::ToReferenceFrame when possible, since it can be expensive when the requested frame isn't the builder's current frame.
Part 10: Make sure we build display items for table parts where only the normal position is visible, since we may need to create background items for ancestors at that position.
Part 11: Create an AutoBuildingDisplayList when we create background items for table columns and column groups, so that we initialize the invalidation state correctly.
Diffstat (limited to 'layout/generic/nsPageFrame.cpp')
-rw-r--r-- | layout/generic/nsPageFrame.cpp | 26 |
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 |