diff options
Diffstat (limited to 'layout')
-rw-r--r-- | layout/base/nsDisplayList.cpp | 19 | ||||
-rw-r--r-- | layout/base/nsDisplayList.h | 21 |
2 files changed, 37 insertions, 3 deletions
diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 1579e69703..8a34d108f1 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -2703,9 +2703,22 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil bg->BottomLayer(), bgRect, useWillPaintBorderOptimization); } - bgItemList.AppendNewToTop( - new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bgRect, bg, - drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0))); + if (aSecondaryReferenceFrame) { + bgItemList.AppendNewToTop( + new (aBuilder) nsDisplayTableBackgroundColor(aBuilder, + aSecondaryReferenceFrame, + bgRect, + bg, + drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0), + aFrame)); + } else { + bgItemList.AppendNewToTop( + new (aBuilder) nsDisplayBackgroundColor(aBuilder, + aFrame, + bgRect, + bg, + drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0))); + } } if (isThemed) { diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index e9047b1135..9cee7b517d 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -3015,6 +3015,27 @@ protected: mozilla::gfx::Color 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 nsDisplayItem { public: |