From f4e66763173c56c3f3181f4a7578f94f45a862d3 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 1 Oct 2019 06:42:47 +0000 Subject: [PATCH] Bug 1363483 - Add nsDisplayTableBackgroundColor to avoid display item collision when processing background color of table. r=mattwoodrow MozReview-Commit-ID: JlYqyRGvtq3 UltraBlame original commit: efdda23fd13d44093c45cf8eabfc67eeab608f18 --- layout/painting/nsDisplayList.cpp | 38 ++++++++++++++ layout/painting/nsDisplayList.h | 87 +++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index d70d8dca21879..e4b05283d88c2 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -16713,6 +16713,43 @@ useWillPaintBorderOptimization ) ; } +if +( +aSecondaryReferenceFrame +) +{ +bgItemList +. +AppendNewToTop +( +new +( +aBuilder +) +nsDisplayTableBackgroundColor +( +aBuilder +aSecondaryReferenceFrame +bgRect +bg +drawBackgroundColor +? +color +: +NS_RGBA +( +0 +0 +0 +0 +) +aFrame +) +) +; +} +else +{ bgItemList . AppendNewToTop @@ -16742,6 +16779,7 @@ NS_RGBA ) ; } +} if ( isThemed diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index b57e270925ed4..cbefc3ae75022 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -10230,6 +10230,93 @@ mColor } ; class +nsDisplayTableBackgroundColor +: +public +nsDisplayBackgroundColor +{ +public +: +nsDisplayTableBackgroundColor +( +nsDisplayListBuilder +* +aBuilder +nsIFrame +* +aFrame +const +nsRect +& +aBackgroundRect +const +nsStyleBackground +* +aBackgroundStyle +nscolor +aColor +nsIFrame +* +aAncestorFrame +) +: +nsDisplayBackgroundColor +( +aBuilder +aFrame +aBackgroundRect +aBackgroundStyle +aColor +) +mTableType +( +GetTableTypeFromFrame +( +aAncestorFrame +) +) +{ +} +virtual +uint32_t +GetPerFrameKey +( +) +override +{ +return +( +static_cast +< +uint8_t +> +( +mTableType +) +< +< +nsDisplayItem +: +: +TYPE_BITS +) +| +nsDisplayItem +: +: +GetPerFrameKey +( +) +; +} +protected +: +TableType +mTableType +; +} +; +class nsDisplayClearBackground : public