diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2020-05-08 01:21:41 +0300 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-05-20 13:49:25 +0000 |
commit | d3d3aad6e52397334844ed80f8db650174937854 (patch) | |
tree | da624662628e938611db00fc64037fd27fb05a37 /layout/tables/nsTableRowGroupFrame.cpp | |
parent | d8d0538162defbb3e44be475c4781bb71f55c2ba (diff) | |
download | UXP-d3d3aad6e52397334844ed80f8db650174937854.tar UXP-d3d3aad6e52397334844ed80f8db650174937854.tar.gz UXP-d3d3aad6e52397334844ed80f8db650174937854.tar.lz UXP-d3d3aad6e52397334844ed80f8db650174937854.tar.xz UXP-d3d3aad6e52397334844ed80f8db650174937854.zip |
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/tables/nsTableRowGroupFrame.cpp')
-rw-r--r-- | layout/tables/nsTableRowGroupFrame.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 1b7f029c8..b6d8a4364 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -207,8 +207,43 @@ void nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) { - nsTableFrame::DisplayGenericTablePart(aBuilder, this, - aLists, DisplayRows); + if (IsVisibleForPainting(aBuilder)) { + // XXXbz should box-shadow for rows/rowgroups/columns/colgroups get painted + // just because we're visible? Or should it depend on the cell visibility + // when we're not the whole table? + + // Paint the outset box-shadows for the table frames + if (StyleEffects()->mBoxShadow) { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayBoxShadowOuter + (aBuilder, this)); + } + } + + for (nsTableRowFrame* row = GetFirstRow(); row; row = row->GetNextRow()) { + if (!aBuilder->GetDirtyRect().Intersects(row->GetVisualOverflowRect() + row->GetNormalPosition())) { + continue; + } + row->PaintCellBackgroundsForFrame(this, aBuilder, aLists, + row->GetNormalPosition()); + } + + if (IsVisibleForPainting(aBuilder)) { + // XXXbz should box-shadow for rows/rowgroups/columns/colgroups get painted + // just because we're visible? Or should it depend on the cell visibility + // when we're not the whole table? + + // Paint the inset box-shadows for the table frames + if (StyleEffects()->mBoxShadow) { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayBoxShadowInner + (aBuilder, this)); + } + } + + DisplayOutline(aBuilder, aLists); + + DisplayRows(aBuilder, this, aLists); } nsIFrame::LogicalSides |