From cbb61ab832508e9c231a256fb161d38d35faeabf Mon Sep 17 00:00:00 2001 From: win7-7 Date: Tue, 25 Feb 2020 00:17:54 +0200 Subject: 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. --- layout/generic/nsContainerFrame.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'layout/generic/nsContainerFrame.cpp') diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index abf687c9b..162e64a3c 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -329,17 +329,15 @@ nsContainerFrame::GetChildLists(nsTArray* aLists) const void nsContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, - const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { DisplayBorderBackgroundOutline(aBuilder, aLists); - BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists); + BuildDisplayListForNonBlockChildren(aBuilder, aLists); } void nsContainerFrame::BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aBuilder, - const nsRect& aDirtyRect, const nsDisplayListSet& aLists, uint32_t aFlags) { @@ -348,7 +346,7 @@ nsContainerFrame::BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aB nsDisplayListSet set(aLists, aLists.Content()); // The children should be in content order while (kid) { - BuildDisplayListForChild(aBuilder, kid, aDirtyRect, set, aFlags); + BuildDisplayListForChild(aBuilder, kid, set, aFlags); kid = kid->GetNextSibling(); } } @@ -1336,13 +1334,12 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres void nsContainerFrame::DisplayOverflowContainers(nsDisplayListBuilder* aBuilder, - const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { nsFrameList* overflowconts = GetPropTableFrames(OverflowContainersProperty()); if (overflowconts) { for (nsIFrame* frame : *overflowconts) { - BuildDisplayListForChild(aBuilder, frame, aDirtyRect, aLists); + BuildDisplayListForChild(aBuilder, frame, aLists); } } } -- cgit v1.2.3 From dba09fa5c43276bb455cc4da6bd0ec302f798189 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 26 Feb 2020 20:51:22 +0100 Subject: Revert "Issue #1355 - Better way to create display items for column backgrounds" This reverts commit 44c47c50388f526c2d134e16d5debebe94a0faf8. --- layout/generic/nsContainerFrame.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'layout/generic/nsContainerFrame.cpp') diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 162e64a3c..abf687c9b 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -329,15 +329,17 @@ nsContainerFrame::GetChildLists(nsTArray* aLists) const void nsContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { DisplayBorderBackgroundOutline(aBuilder, aLists); - BuildDisplayListForNonBlockChildren(aBuilder, aLists); + BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists); } void nsContainerFrame::BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, const nsDisplayListSet& aLists, uint32_t aFlags) { @@ -346,7 +348,7 @@ nsContainerFrame::BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aB nsDisplayListSet set(aLists, aLists.Content()); // The children should be in content order while (kid) { - BuildDisplayListForChild(aBuilder, kid, set, aFlags); + BuildDisplayListForChild(aBuilder, kid, aDirtyRect, set, aFlags); kid = kid->GetNextSibling(); } } @@ -1334,12 +1336,13 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres void nsContainerFrame::DisplayOverflowContainers(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { nsFrameList* overflowconts = GetPropTableFrames(OverflowContainersProperty()); if (overflowconts) { for (nsIFrame* frame : *overflowconts) { - BuildDisplayListForChild(aBuilder, frame, aLists); + BuildDisplayListForChild(aBuilder, frame, aDirtyRect, aLists); } } } -- cgit v1.2.3 From 96afb5250d1d89dbd445c91e45b650dca0c5cb64 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 10 Apr 2020 21:48:39 +0200 Subject: Issue #1511 - Bail on orphan situation. This resolves #1511 --- layout/generic/nsContainerFrame.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'layout/generic/nsContainerFrame.cpp') diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index abf687c9b..da6e6cf79 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -1925,6 +1925,10 @@ nsContainerFrame::RenumberFrameAndDescendants(int32_t* aOrdinal, nsIFrame *f = bullet; do { nsIFrame *parent = f->GetParent(); + if (!parent) { + // We may have an orphan situation in some corner cases. + break; + } parent->ChildIsDirty(f); f = parent; } while (f != listItem); -- cgit v1.2.3 From 9a52b3b852181bc956a97dbff1da68cf8ef415a2 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 10 Apr 2020 21:51:32 +0200 Subject: [layout] Always move descendants of layout frames if moved. If we move the frame then we always need to move any descendant views, not just in case the frame itself has a view. --- layout/generic/nsContainerFrame.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'layout/generic/nsContainerFrame.cpp') diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index da6e6cf79..3ff6c9bf1 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -1031,6 +1031,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) { PositionFrameView(aKidFrame); + PositionChildViews(aKidFrame); } // Reflow the child frame @@ -1074,6 +1075,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) { PositionFrameView(aKidFrame); + PositionChildViews(aKidFrame); } // Reflow the child frame -- cgit v1.2.3