mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1438165 - Ensure that all display items have a unique type r=mattwoodrow
MozReview-Commit-ID: HIlSQFcvG9A --HG-- extra : rebase_source : aba9cdf8e578ed3fd98a77aef8a183dac08baea1 extra : amend_source : 329ff3b9124c05b35ff1e0807afe9ac455bbebce
This commit is contained in:
parent
763b589345
commit
7a19c4858c
@ -5231,15 +5231,21 @@ AddCanvasBackgroundColor(const nsDisplayList& aList, nsIFrame* aCanvasFrame,
|
||||
nscolor aColor, bool aCSSBackgroundColor)
|
||||
{
|
||||
for (nsDisplayItem* i = aList.GetBottom(); i; i = i->GetAbove()) {
|
||||
const DisplayItemType type = i->GetType();
|
||||
|
||||
if (i->Frame() == aCanvasFrame &&
|
||||
i->GetType() == DisplayItemType::TYPE_CANVAS_BACKGROUND_COLOR) {
|
||||
type == DisplayItemType::TYPE_CANVAS_BACKGROUND_COLOR) {
|
||||
nsDisplayCanvasBackgroundColor* bg = static_cast<nsDisplayCanvasBackgroundColor*>(i);
|
||||
bg->SetExtraBackgroundColor(aColor);
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool isBlendContainer =
|
||||
type == DisplayItemType::TYPE_BLEND_CONTAINER ||
|
||||
type == DisplayItemType::TYPE_TABLE_BLEND_CONTAINER;
|
||||
|
||||
nsDisplayList* sublist = i->GetSameCoordinateSystemChildren();
|
||||
if (sublist &&
|
||||
!(i->GetType() == DisplayItemType::TYPE_BLEND_CONTAINER && !aCSSBackgroundColor) &&
|
||||
if (sublist && !(isBlendContainer && !aCSSBackgroundColor) &&
|
||||
AddCanvasBackgroundColor(*sublist, aCanvasFrame, aColor, aCSSBackgroundColor))
|
||||
return true;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@ DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(THEMED_BACKGROUND, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND_COLOR, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BLEND_CONTAINER, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_BLEND_CONTAINER, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BLEND_MODE, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_BLEND_MODE, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BORDER, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_OUTER, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_INNER, TYPE_RENDERS_NO_IMAGES)
|
||||
@ -59,12 +61,14 @@ DECLARE_DISPLAY_ITEM_TYPE(FILTER, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(SVG_OUTER_SVG, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(SVG_GEOMETRY, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(SVG_TEXT, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(SVG_CHAR_CLIP, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(SVG_WRAPPER, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_BACKGROUND, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_SELECTION, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_COLLAPSE, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_BACKGROUND_COLOR, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_BACKGROUND_IMAGE, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_THEMED_BACKGROUND_IMAGE, 0)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TABLE_FIXED_POSITION, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TEXT, TYPE_RENDERS_NO_IMAGES)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(TEXT_OVERFLOW, TYPE_RENDERS_NO_IMAGES)
|
||||
|
@ -1572,8 +1572,8 @@ nsDisplayListBuilder::Allocate(size_t aSize, DisplayItemType aType)
|
||||
size_t roundedUpSize = RoundUpPow2(aSize);
|
||||
uint_fast8_t type = FloorLog2Size(roundedUpSize);
|
||||
|
||||
MOZ_ASSERT(gDisplayItemSizes[static_cast<uint32_t>(aType)] == type ||
|
||||
gDisplayItemSizes[static_cast<uint32_t>(aType)] == 0);
|
||||
MOZ_RELEASE_ASSERT(gDisplayItemSizes[static_cast<uint32_t>(aType)] == type ||
|
||||
gDisplayItemSizes[static_cast<uint32_t>(aType)] == 0);
|
||||
gDisplayItemSizes[static_cast<uint32_t>(aType)] = type;
|
||||
return mPool.AllocateByCustomID(type, roundedUpSize);
|
||||
}
|
||||
@ -6367,7 +6367,9 @@ RequiredLayerStateForChildren(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
LayerState state = i->GetLayerState(aBuilder, aManager, aParameters);
|
||||
if (state == LAYER_ACTIVE && i->GetType() == DisplayItemType::TYPE_BLEND_MODE) {
|
||||
if (state == LAYER_ACTIVE &&
|
||||
(i->GetType() == DisplayItemType::TYPE_BLEND_MODE ||
|
||||
i->GetType() == DisplayItemType::TYPE_TABLE_BLEND_MODE)) {
|
||||
// nsDisplayBlendMode always returns LAYER_ACTIVE to ensure that the
|
||||
// blending operation happens in the intermediate surface of its parent
|
||||
// display item (usually an nsDisplayBlendContainer). But this does not
|
||||
|
@ -4136,7 +4136,7 @@ public:
|
||||
|
||||
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
|
||||
|
||||
NS_DISPLAY_DECL_NAME("TableThemedBackground", TYPE_TABLE_BACKGROUND_IMAGE)
|
||||
NS_DISPLAY_DECL_NAME("TableThemedBackground", TYPE_TABLE_THEMED_BACKGROUND_IMAGE)
|
||||
protected:
|
||||
virtual nsIFrame* StyleFrame() const override { return mAncestorFrame; }
|
||||
nsIFrame* mAncestorFrame;
|
||||
@ -5259,7 +5259,7 @@ public:
|
||||
nsDisplayItem::GetPerFrameKey();
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("BlendMode", TYPE_BLEND_MODE)
|
||||
NS_DISPLAY_DECL_NAME("TableBlendMode", TYPE_TABLE_BLEND_MODE)
|
||||
|
||||
protected:
|
||||
nsIFrame* mAncestorFrame;
|
||||
@ -5354,7 +5354,7 @@ public:
|
||||
nsDisplayItem::GetPerFrameKey();
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("BlendContainer", TYPE_BLEND_CONTAINER)
|
||||
NS_DISPLAY_DECL_NAME("TableBlendContainer", TYPE_TABLE_BLEND_CONTAINER)
|
||||
|
||||
protected:
|
||||
nsDisplayTableBlendContainer(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||
@ -6680,7 +6680,8 @@ public:
|
||||
|
||||
static nsCharClipDisplayItem* CheckCast(nsDisplayItem* aItem) {
|
||||
DisplayItemType t = aItem->GetType();
|
||||
return (t == DisplayItemType::TYPE_TEXT)
|
||||
return (t == DisplayItemType::TYPE_TEXT ||
|
||||
t == DisplayItemType::TYPE_SVG_CHAR_CLIP)
|
||||
? static_cast<nsCharClipDisplayItem*>(aItem) : nullptr;
|
||||
}
|
||||
|
||||
|
@ -2733,7 +2733,7 @@ public:
|
||||
aRun.GetClipEdges(mVisIStartEdge, mVisIEndEdge);
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("SVGText", TYPE_TEXT)
|
||||
NS_DISPLAY_DECL_NAME("SVGCharClip", TYPE_SVG_CHAR_CLIP)
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user