mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Backed out changeset e41fa1543360 (bug 929484)
This commit is contained in:
parent
2121f93271
commit
dec7071863
@ -83,8 +83,6 @@
|
|||||||
#include "nsCSSProps.h"
|
#include "nsCSSProps.h"
|
||||||
#include "nsPluginFrame.h"
|
#include "nsPluginFrame.h"
|
||||||
#include "nsSVGMaskFrame.h"
|
#include "nsSVGMaskFrame.h"
|
||||||
#include "nsTableCellFrame.h"
|
|
||||||
#include "nsTableColFrame.h"
|
|
||||||
#include "ClientLayerManager.h"
|
#include "ClientLayerManager.h"
|
||||||
#include "mozilla/layers/WebRenderBridgeChild.h"
|
#include "mozilla/layers/WebRenderBridgeChild.h"
|
||||||
#include "mozilla/layers/WebRenderLayerManager.h"
|
#include "mozilla/layers/WebRenderLayerManager.h"
|
||||||
@ -3065,8 +3063,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||||||
nsDisplayList* aList,
|
nsDisplayList* aList,
|
||||||
bool aAllowWillPaintBorderOptimization,
|
bool aAllowWillPaintBorderOptimization,
|
||||||
nsStyleContext* aStyleContext,
|
nsStyleContext* aStyleContext,
|
||||||
const nsRect& aBackgroundOriginRect,
|
const nsRect& aBackgroundOriginRect)
|
||||||
nsIFrame* aSecondaryReferenceFrame)
|
|
||||||
{
|
{
|
||||||
nsStyleContext* bgSC = aStyleContext;
|
nsStyleContext* bgSC = aStyleContext;
|
||||||
const nsStyleBackground* bg = nullptr;
|
const nsStyleBackground* bg = nullptr;
|
||||||
@ -3216,17 +3213,8 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||||||
bgImageClip.Clear();
|
bgImageClip.Clear();
|
||||||
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
|
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
|
||||||
}
|
}
|
||||||
if (aSecondaryReferenceFrame) {
|
thisItemList.AppendNewToTop(
|
||||||
thisItemList.AppendNewToTop(
|
nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, aFrame, bgItem, i));
|
||||||
nsDisplayTableFixedPosition::CreateForFixedBackground(aBuilder,
|
|
||||||
aSecondaryReferenceFrame,
|
|
||||||
bgItem,
|
|
||||||
i,
|
|
||||||
aFrame));
|
|
||||||
} else {
|
|
||||||
thisItemList.AppendNewToTop(
|
|
||||||
nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, aFrame, bgItem, i));
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
thisItemList.AppendNewToTop(new (aBuilder) nsDisplayBackgroundImage(bgData));
|
thisItemList.AppendNewToTop(new (aBuilder) nsDisplayBackgroundImage(bgData));
|
||||||
@ -6446,60 +6434,6 @@ bool nsDisplayFixedPosition::TryMerge(nsDisplayItem* aItem) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
TableType
|
|
||||||
GetTableTypeFromFrame(nsIFrame* aFrame)
|
|
||||||
{
|
|
||||||
if (aFrame->IsTableFrame()) {
|
|
||||||
return TableType::TABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aFrame->IsTableColFrame()) {
|
|
||||||
return TableType::TABLE_COL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aFrame->IsTableColGroupFrame()) {
|
|
||||||
return TableType::TABLE_COL_GROUP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aFrame->IsTableRowFrame()) {
|
|
||||||
return TableType::TABLE_ROW;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aFrame->IsTableRowGroupFrame()) {
|
|
||||||
return TableType::TABLE_ROW_GROUP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aFrame->IsTableCellFrame()) {
|
|
||||||
return TableType::TABLE_CELL;
|
|
||||||
}
|
|
||||||
|
|
||||||
MOZ_ASSERT_UNREACHABLE("Invalid frame.");
|
|
||||||
return TableType::TABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsDisplayTableFixedPosition::nsDisplayTableFixedPosition(nsDisplayListBuilder* aBuilder,
|
|
||||||
nsIFrame* aFrame,
|
|
||||||
nsDisplayList* aList,
|
|
||||||
uint32_t aIndex,
|
|
||||||
nsIFrame* aAncestorFrame)
|
|
||||||
: nsDisplayFixedPosition(aBuilder, aFrame, aList, aIndex)
|
|
||||||
, mTableType(GetTableTypeFromFrame(aAncestorFrame))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */ nsDisplayTableFixedPosition*
|
|
||||||
nsDisplayTableFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBuilder,
|
|
||||||
nsIFrame* aFrame,
|
|
||||||
nsDisplayBackgroundImage* aImage,
|
|
||||||
uint32_t aIndex,
|
|
||||||
nsIFrame* aAncestorFrame)
|
|
||||||
{
|
|
||||||
nsDisplayList temp;
|
|
||||||
temp.AppendToTop(aImage);
|
|
||||||
|
|
||||||
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsDisplayStickyPosition::nsDisplayStickyPosition(nsDisplayListBuilder* aBuilder,
|
nsDisplayStickyPosition::nsDisplayStickyPosition(nsDisplayListBuilder* aBuilder,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsDisplayList* aList,
|
nsDisplayList* aList,
|
||||||
|
@ -3072,8 +3072,7 @@ public:
|
|||||||
nsDisplayList* aList,
|
nsDisplayList* aList,
|
||||||
bool aAllowWillPaintBorderOptimization = true,
|
bool aAllowWillPaintBorderOptimization = true,
|
||||||
nsStyleContext* aStyleContext = nullptr,
|
nsStyleContext* aStyleContext = nullptr,
|
||||||
const nsRect& aBackgroundOriginRect = nsRect(),
|
const nsRect& aBackgroundOriginRect = nsRect());
|
||||||
nsIFrame* aSecondaryReferenceFrame = nullptr);
|
|
||||||
|
|
||||||
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
||||||
LayerManager* aManager,
|
LayerManager* aManager,
|
||||||
@ -3175,25 +3174,6 @@ protected:
|
|||||||
bool mShouldFixToViewport;
|
bool mShouldFixToViewport;
|
||||||
};
|
};
|
||||||
|
|
||||||
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.
|
* A display item to paint the native theme background for a frame.
|
||||||
@ -4143,7 +4123,7 @@ public:
|
|||||||
return mAnimatedGeometryRootForScrollMetadata;
|
return mAnimatedGeometryRootForScrollMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
// For background-attachment:fixed
|
// For background-attachment:fixed
|
||||||
nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||||
nsDisplayList* aList, uint32_t aIndex);
|
nsDisplayList* aList, uint32_t aIndex);
|
||||||
@ -4154,27 +4134,6 @@ protected:
|
|||||||
bool mIsFixedBackground;
|
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.
|
* 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
|
* It is used to record the existence of a scrollable frame in the layer
|
||||||
|
@ -1311,8 +1311,7 @@ PaintRowBackground(nsTableRowFrame* aRow,
|
|||||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect,
|
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect,
|
||||||
aLists.BorderBackground(),
|
aLists.BorderBackground(),
|
||||||
true, nullptr,
|
true, nullptr,
|
||||||
aFrame->GetRectRelativeToSelf(),
|
aFrame->GetRectRelativeToSelf());
|
||||||
cell);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1344,8 +1343,7 @@ PaintRowGroupBackgroundByColIdx(nsTableRowGroupFrame* aRowGroup,
|
|||||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect,
|
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect,
|
||||||
aLists.BorderBackground(),
|
aLists.BorderBackground(),
|
||||||
true, nullptr,
|
true, nullptr,
|
||||||
aFrame->GetRectRelativeToSelf(),
|
aFrame->GetRectRelativeToSelf());
|
||||||
cell);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user