summaryrefslogtreecommitdiffstats
path: root/layout/base/nsDisplayList.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-03 15:12:34 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-03 15:12:34 +0100
commitdb98e3efff6087b690805358e6f4fda118ec9627 (patch)
tree6c0478110100bdf85f1fa088a86b206905a25f96 /layout/base/nsDisplayList.h
parent0de40040f006c493feeff7d688c169b904b8a22e (diff)
downloadUXP-db98e3efff6087b690805358e6f4fda118ec9627.tar
UXP-db98e3efff6087b690805358e6f4fda118ec9627.tar.gz
UXP-db98e3efff6087b690805358e6f4fda118ec9627.tar.lz
UXP-db98e3efff6087b690805358e6f4fda118ec9627.tar.xz
UXP-db98e3efff6087b690805358e6f4fda118ec9627.zip
Issue #146 - Part 3: Create nsDisplayTableFixedPosition to avoid display
list collisions when processing the background image of a table.
Diffstat (limited to 'layout/base/nsDisplayList.h')
-rw-r--r--layout/base/nsDisplayList.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h
index 9431e2cc0..69d13ded9 100644
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -2738,7 +2738,8 @@ public:
nsDisplayList* aList,
bool aAllowWillPaintBorderOptimization = true,
nsStyleContext* aStyleContext = nullptr,
- const nsRect& aBackgroundOriginRect = nsRect());
+ const nsRect& aBackgroundOriginRect = nsRect(),
+ nsIFrame* aSecondaryReferenceFrame = nullptr);
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
@@ -2838,6 +2839,25 @@ protected:
bool mShouldTreatAsFixed;
};
+enum class TableType : uint8_t {
+ TABLE,
+ TABLE_COL,
+ TABLE_COL_GROUP,
+ TABLE_ROW,
+ TABLE_ROW_GROUP,
+ TABLE_CELL,
+
+ TABLE_TYPE_MAX
+};
+
+enum class TableTypeBits : uint8_t {
+ COUNT = 3
+};
+
+static_assert(
+ static_cast<uint8_t>(TableType::TABLE_TYPE_MAX) < (1 << (static_cast<uint8_t>(TableTypeBits::COUNT) + 1)),
+ "TableType cannot fit with TableTypeBits::COUNT");
+TableType GetTableTypeFromFrame(nsIFrame* aFrame);
/**
* A display item to paint the native theme background for a frame.
@@ -3736,7 +3756,7 @@ public:
return mAnimatedGeometryRootForScrollMetadata;
}
-private:
+protected:
// For background-attachment:fixed
nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList, uint32_t aIndex);
@@ -3747,6 +3767,27 @@ private:
bool mIsFixedBackground;
};
+class nsDisplayTableFixedPosition : public nsDisplayFixedPosition
+{
+public:
+ static nsDisplayTableFixedPosition* CreateForFixedBackground(nsDisplayListBuilder* aBuilder,
+ nsIFrame* aFrame,
+ nsDisplayBackgroundImage* aImage,
+ uint32_t aIndex,
+ nsIFrame* aAncestorFrame);
+
+ virtual uint32_t GetPerFrameKey() override {
+ return (mIndex << (nsDisplayItem::TYPE_BITS + static_cast<uint8_t>(TableTypeBits::COUNT))) |
+ (static_cast<uint8_t>(mTableType) << nsDisplayItem::TYPE_BITS) |
+ nsDisplayItem::GetPerFrameKey();
+ }
+protected:
+ nsDisplayTableFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
+ nsDisplayList* aList, uint32_t aIndex, nsIFrame* aAncestorFrame);
+
+ TableType mTableType;
+};
+
/**
* This creates an empty scrollable layer. It has no child layers.
* It is used to record the existence of a scrollable frame in the layer