diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-02 22:39:03 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-02 22:42:07 +0100 |
commit | 787ec5e40f5f731cf8320f49709f70d5eb5dd1f9 (patch) | |
tree | a285c388b5f554a60f42ef0db19c1cee327b8950 /layout/base | |
parent | 7cb37ac8db4c7c6be412b76bf2ce1e5f0f2620ee (diff) | |
download | uxp-787ec5e40f5f731cf8320f49709f70d5eb5dd1f9.tar.gz |
Issue mcp-graveyard/UXP#146 - Part 1: Draw each table's background on their own display
list items.
This patch does the following things:
1. Creates nsDisplayTableBorderCollapse that draws all collapse border
of tables.
2. Stops the use of nsDisplayTableBorderBackground.
3. Lets column and column group frames generate display items.
4. When traversing the table, also traverses the column and column group
frames.
5. For each type of table frame (col group, col, row group, row and
cell), draws their own background.
Diffstat (limited to 'layout/base')
-rw-r--r-- | layout/base/nsDisplayItemTypesList.h | 1 | ||||
-rw-r--r-- | layout/base/nsDisplayList.cpp | 9 | ||||
-rw-r--r-- | layout/base/nsDisplayList.h | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/layout/base/nsDisplayItemTypesList.h b/layout/base/nsDisplayItemTypesList.h index 9865395a79..d24f6f38fb 100644 --- a/layout/base/nsDisplayItemTypesList.h +++ b/layout/base/nsDisplayItemTypesList.h @@ -59,6 +59,7 @@ DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_SELECTION) DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_BACKGROUND) DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_GROUP_BACKGROUND) DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_BACKGROUND) +DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_COLLAPSE) DECLARE_DISPLAY_ITEM_TYPE(TEXT) DECLARE_DISPLAY_ITEM_TYPE(TEXT_OVERFLOW) DECLARE_DISPLAY_ITEM_TYPE_FLAGS(TRANSFORM,TYPE_RENDERS_NO_IMAGES) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index e22230b410..744153831d 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -2631,11 +2631,16 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil const nsRect& aBackgroundRect, nsDisplayList* aList, bool aAllowWillPaintBorderOptimization, - nsStyleContext* aStyleContext) + nsStyleContext* aStyleContext, + const nsRect& aBackgroundOriginRect) { nsStyleContext* bgSC = aStyleContext; const nsStyleBackground* bg = nullptr; nsRect bgRect = aBackgroundRect + aBuilder->ToReferenceFrame(aFrame); + nsRect bgOriginRect = bgRect; + if (!aBackgroundOriginRect.IsEmpty()) { + bgOriginRect = aBackgroundOriginRect + aBuilder->ToReferenceFrame(aFrame); + } nsPresContext* presContext = aFrame->PresContext(); bool isThemed = aFrame->IsThemed(); if (!isThemed) { @@ -2744,7 +2749,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil nsDisplayList thisItemList; nsDisplayBackgroundImage* bgItem = - new (aBuilder) nsDisplayBackgroundImage(aBuilder, aFrame, i, bgRect, bg); + new (aBuilder) nsDisplayBackgroundImage(aBuilder, aFrame, i, bgOriginRect, bg); if (bgItem->ShouldFixToViewport(aBuilder)) { thisItemList.AppendNewToTop( diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index c81d34fac2..9431e2cc06 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2737,7 +2737,8 @@ public: const nsRect& aBackgroundRect, nsDisplayList* aList, bool aAllowWillPaintBorderOptimization = true, - nsStyleContext* aStyleContext = nullptr); + nsStyleContext* aStyleContext = nullptr, + const nsRect& aBackgroundOriginRect = nsRect()); virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, |