mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Backed out changeset 0f783930e1b2 (bug 1406727) for GTest failures on ArenaAllocator. r=backout on a CLOSED TREE
This commit is contained in:
parent
f98054e952
commit
af710e4746
@ -227,6 +227,7 @@ struct RangePaintInfo {
|
||||
RangePaintInfo(nsRange* aRange, nsIFrame* aFrame)
|
||||
: mRange(aRange)
|
||||
, mBuilder(aFrame, nsDisplayListBuilderMode::PAINTING, false)
|
||||
, mList(&mBuilder)
|
||||
{
|
||||
MOZ_COUNT_CTOR(RangePaintInfo);
|
||||
mBuilder.BeginFrame();
|
||||
@ -4793,7 +4794,7 @@ PresShell::ClipListToRange(nsDisplayListBuilder *aBuilder,
|
||||
// part of the selection. Then, append the wrapper to the top of the list.
|
||||
// Otherwise, just delete the item and don't append it.
|
||||
nsRect surfaceRect;
|
||||
nsDisplayList tmpList;
|
||||
nsDisplayList tmpList(aBuilder);
|
||||
|
||||
nsDisplayItem* i;
|
||||
while ((i = aList->RemoveBottom())) {
|
||||
|
@ -3020,7 +3020,7 @@ nsLayoutUtils::GetLayerTransformForFrame(nsIFrame* aFrame,
|
||||
nsDisplayListBuilderMode::TRANSFORM_COMPUTATION,
|
||||
false/*don't build caret*/);
|
||||
builder.BeginFrame();
|
||||
nsDisplayList list;
|
||||
nsDisplayList list(&builder);
|
||||
nsDisplayTransform* item =
|
||||
new (&builder) nsDisplayTransform(&builder, aFrame, &list, nsRect());
|
||||
|
||||
@ -3303,7 +3303,7 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
|
||||
nsDisplayListBuilderMode::EVENT_DELIVERY,
|
||||
false);
|
||||
builder.BeginFrame();
|
||||
nsDisplayList list;
|
||||
nsDisplayList list(&builder);
|
||||
|
||||
if (aFlags & IGNORE_PAINT_SUPPRESSION) {
|
||||
builder.IgnorePaintSuppression();
|
||||
@ -3684,7 +3684,7 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
||||
} else {
|
||||
nonRetainedBuilder.emplace(aFrame, aBuilderMode, buildCaret);
|
||||
builderPtr = nonRetainedBuilder.ptr();
|
||||
nonRetainedList.emplace();
|
||||
nonRetainedList.emplace(builderPtr);
|
||||
listPtr = nonRetainedList.ptr();
|
||||
}
|
||||
nsDisplayListBuilder& builder = *builderPtr;
|
||||
@ -3863,8 +3863,6 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
||||
}
|
||||
}
|
||||
|
||||
builder.Check();
|
||||
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::PAINT_BUILD_DISPLAYLIST_TIME,
|
||||
startBuildDisplayList);
|
||||
|
||||
@ -3944,8 +3942,6 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::PAINT_RASTERIZE_TIME,
|
||||
paintStart);
|
||||
|
||||
builder.Check();
|
||||
|
||||
if (gfxPrefs::GfxLoggingPaintedPixelCountEnabled()) {
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
float rasterizeTime = (now - paintStart).ToMilliseconds();
|
||||
@ -4051,8 +4047,6 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
||||
}
|
||||
}
|
||||
|
||||
builder.Check();
|
||||
|
||||
{
|
||||
AUTO_PROFILER_TRACING("Paint", "DisplayListResources");
|
||||
|
||||
|
@ -111,8 +111,8 @@ public:
|
||||
void AddSizeOfExcludingThis(nsWindowSizes& aWindowSizes) const;
|
||||
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
void Check() {
|
||||
mPool.Check();
|
||||
bool DebugContains(void* aPtr) {
|
||||
return mPool.DebugContains(aPtr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -106,7 +106,7 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
eventClipState->ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr);
|
||||
}
|
||||
|
||||
nsDisplayList onTop;
|
||||
nsDisplayList onTop(aBuilder);
|
||||
if (IsVisibleForPainting(aBuilder)) {
|
||||
mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
|
||||
}
|
||||
|
@ -326,6 +326,7 @@ TextOverflow::TextOverflow(nsDisplayListBuilder* aBuilder,
|
||||
, mBuilder(aBuilder)
|
||||
, mBlock(aBlockFrame)
|
||||
, mScrollableFrame(nsLayoutUtils::GetScrollableFrameFor(aBlockFrame))
|
||||
, mMarkerList(aBuilder)
|
||||
, mBlockSize(aBlockFrame->GetSize())
|
||||
, mBlockWM(aBlockFrame->GetWritingMode())
|
||||
, mAdjustForPixelSnapping(false)
|
||||
@ -754,7 +755,7 @@ TextOverflow::PruneDisplayListContents(nsDisplayList* aList,
|
||||
const FrameHashtable& aFramesToHide,
|
||||
const LogicalRect& aInsideMarkersArea)
|
||||
{
|
||||
nsDisplayList saved;
|
||||
nsDisplayList saved(mBuilder);
|
||||
nsDisplayItem* item;
|
||||
while ((item = aList->RemoveBottom())) {
|
||||
nsIFrame* itemFrame = item->Frame();
|
||||
|
@ -66,7 +66,7 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
BuildDisplayListForChild(aBuilder, kid, aLists);
|
||||
}
|
||||
|
||||
nsDisplayList topLayerList;
|
||||
nsDisplayList topLayerList(aBuilder);
|
||||
BuildDisplayListForTopLayer(aBuilder, &topLayerList);
|
||||
if (!topLayerList.IsEmpty()) {
|
||||
// Wrap the whole top layer in a single item with maximum z-index,
|
||||
@ -130,7 +130,7 @@ BuildDisplayListForTopLayerFrame(nsDisplayListBuilder* aBuilder,
|
||||
buildingForChild(aBuilder, aFrame, visible, dirty,
|
||||
aBuilder->IsAtRootOfPseudoStackingContext());
|
||||
|
||||
nsDisplayList list;
|
||||
nsDisplayList list(aBuilder);
|
||||
aFrame->BuildDisplayListForStackingContext(aBuilder, &list);
|
||||
aList->AppendToTop(&list);
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
nsRect bgRect = GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(this);
|
||||
|
||||
const ActiveScrolledRoot* thisItemASR = asr;
|
||||
nsDisplayList thisItemList;
|
||||
nsDisplayList thisItemList(aBuilder);
|
||||
nsDisplayBackgroundImage::InitData bgData =
|
||||
nsDisplayBackgroundImage::GetInitData(aBuilder, this, i, bgRect, bg,
|
||||
nsDisplayBackgroundImage::LayerizeFixed::ALWAYS_LAYERIZE_FIXED_BACKGROUND);
|
||||
|
@ -2828,7 +2828,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
bool usingSVGEffects = usingFilter || usingMask;
|
||||
|
||||
nsRect visibleRectOutsideSVGEffects = visibleRect;
|
||||
nsDisplayList hoistedScrollInfoItemsStorage;
|
||||
nsDisplayList hoistedScrollInfoItemsStorage(aBuilder);
|
||||
if (usingSVGEffects) {
|
||||
dirtyRect =
|
||||
nsSVGIntegrationUtils::GetRequiredSourceForInvalidArea(this, dirtyRect);
|
||||
@ -3049,7 +3049,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
// element itself.
|
||||
set.PositionedDescendants()->SortByZOrder();
|
||||
|
||||
nsDisplayList resultList;
|
||||
nsDisplayList resultList(aBuilder);
|
||||
// Now follow the rules of http://www.w3.org/TR/CSS21/zindex.html
|
||||
// 1,2: backgrounds and borders
|
||||
resultList.AppendToTop(set.BorderBackground());
|
||||
@ -3200,8 +3200,8 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
if (isTransformed && extend3DContext) {
|
||||
// Install dummy nsDisplayTransform as a leaf containing
|
||||
// descendants not participating this 3D rendering context.
|
||||
nsDisplayList nonparticipants;
|
||||
nsDisplayList participants;
|
||||
nsDisplayList nonparticipants(aBuilder);
|
||||
nsDisplayList participants(aBuilder);
|
||||
int index = 1;
|
||||
|
||||
while (nsDisplayItem* item = resultList.RemoveBottom()) {
|
||||
@ -3638,8 +3638,8 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||
awayFromCommonPath = true;
|
||||
}
|
||||
|
||||
nsDisplayList list;
|
||||
nsDisplayList extraPositionedDescendants;
|
||||
nsDisplayList list(aBuilder);
|
||||
nsDisplayList extraPositionedDescendants(aBuilder);
|
||||
const ActiveScrolledRoot* wrapListASR = aBuilder->CurrentActiveScrolledRoot();
|
||||
bool canSkipWrapList = false;
|
||||
if (isStackingContext) {
|
||||
|
@ -407,7 +407,7 @@ PruneDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
|
||||
nsPageFrame* aPage, nsIFrame* aExtraPage,
|
||||
nsDisplayList* aList)
|
||||
{
|
||||
nsDisplayList newList;
|
||||
nsDisplayList newList(aBuilder);
|
||||
|
||||
while (true) {
|
||||
nsDisplayItem* i = aList->RemoveBottom();
|
||||
@ -443,7 +443,7 @@ BuildDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
|
||||
if (!aExtraPage->HasAnyStateBits(NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)) {
|
||||
return;
|
||||
}
|
||||
nsDisplayList list;
|
||||
nsDisplayList list(aBuilder);
|
||||
aExtraPage->BuildDisplayListForStackingContext(aBuilder, &list);
|
||||
PruneDisplayListForExtraPage(aBuilder, aPage, aExtraPage, &list);
|
||||
aList->AppendToTop(&list);
|
||||
@ -538,7 +538,7 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
clipRect += aBuilder->ToReferenceFrame(child);
|
||||
|
||||
nsDisplayList content;
|
||||
nsDisplayList content(aBuilder);
|
||||
{
|
||||
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
|
||||
|
||||
|
@ -830,7 +830,7 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
{
|
||||
DisplayBorderBackgroundOutline(aBuilder, aLists);
|
||||
|
||||
nsDisplayList content;
|
||||
nsDisplayList content(aBuilder);
|
||||
|
||||
{
|
||||
// Clear clip state while we construct the children of the
|
||||
|
@ -312,11 +312,11 @@ WrapBackgroundColorInOwnLayer(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame,
|
||||
nsDisplayList* aList)
|
||||
{
|
||||
nsDisplayList tempItems;
|
||||
nsDisplayList tempItems(aBuilder);
|
||||
nsDisplayItem* item;
|
||||
while ((item = aList->RemoveBottom()) != nullptr) {
|
||||
if (item->GetType() == DisplayItemType::TYPE_BACKGROUND_COLOR) {
|
||||
nsDisplayList tmpList;
|
||||
nsDisplayList tmpList(aBuilder);
|
||||
tmpList.AppendToTop(item);
|
||||
item = new (aBuilder) nsDisplayOwnLayer(aBuilder, aFrame, &tmpList, aBuilder->CurrentActiveScrolledRoot());
|
||||
}
|
||||
@ -472,7 +472,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
mPreviousCaret = aBuilder->GetCaretFrame();
|
||||
}
|
||||
|
||||
nsDisplayList childItems;
|
||||
nsDisplayList childItems(aBuilder);
|
||||
|
||||
{
|
||||
DisplayListClipState::AutoSaveRestore nestedClipState(aBuilder);
|
||||
|
@ -86,7 +86,7 @@ void
|
||||
RetainedDisplayListBuilder::PreProcessDisplayList(nsDisplayList* aList,
|
||||
AnimatedGeometryRoot* aAGR)
|
||||
{
|
||||
nsDisplayList saved;
|
||||
nsDisplayList saved(&mBuilder);
|
||||
while (nsDisplayItem* i = aList->RemoveBottom()) {
|
||||
if (i->HasDeletedFrame() || !i->CanBeReused()) {
|
||||
i->Destroy(&mBuilder);
|
||||
@ -353,7 +353,7 @@ RetainedDisplayListBuilder::MergeDisplayLists(nsDisplayList* aNewList,
|
||||
nsDisplayList* aOutList,
|
||||
Maybe<const ActiveScrolledRoot*>& aOutContainerASR)
|
||||
{
|
||||
nsDisplayList merged;
|
||||
nsDisplayList merged(&mBuilder);
|
||||
const auto UseItem = [&](nsDisplayItem* aItem) {
|
||||
const ActiveScrolledRoot* itemClipASR =
|
||||
aItem->GetClipChain() ? aItem->GetClipChain()->mASR : nullptr;
|
||||
@ -433,7 +433,7 @@ RetainedDisplayListBuilder::MergeDisplayLists(nsDisplayList* aNewList,
|
||||
// Recurse into the child list (without a matching new list) to
|
||||
// ensure that we find and remove any invalidated items.
|
||||
if (old->GetChildren()) {
|
||||
nsDisplayList empty;
|
||||
nsDisplayList empty(&mBuilder);
|
||||
Maybe<const ActiveScrolledRoot*> containerASRForChildren;
|
||||
MergeDisplayLists(&empty, old->GetChildren(),
|
||||
old->GetChildren(), containerASRForChildren);
|
||||
@ -490,7 +490,7 @@ RetainedDisplayListBuilder::MergeDisplayLists(nsDisplayList* aNewList,
|
||||
// with modified or deleted children will be correctly handled.
|
||||
// Passing an empty new display list as an argument skips the merging
|
||||
// loop above and jumps back here.
|
||||
nsDisplayList empty;
|
||||
nsDisplayList empty(&mBuilder);
|
||||
Maybe<const ActiveScrolledRoot*> containerASRForChildren;
|
||||
|
||||
MergeDisplayLists(&empty, old->GetChildren(),
|
||||
@ -822,7 +822,7 @@ RetainedDisplayListBuilder::AttemptPartialUpdate(nscolor aBackstop)
|
||||
|
||||
PreProcessDisplayList(&mList, modifiedAGR);
|
||||
|
||||
nsDisplayList modifiedDL;
|
||||
nsDisplayList modifiedDL(&mBuilder);
|
||||
if (!modifiedDirty.IsEmpty() || !framesWithProps.IsEmpty()) {
|
||||
mBuilder.SetDirtyRect(modifiedDirty);
|
||||
mBuilder.SetPartialUpdate(true);
|
||||
|
@ -15,6 +15,7 @@ struct RetainedDisplayListBuilder {
|
||||
nsDisplayListBuilderMode aMode,
|
||||
bool aBuildCaret)
|
||||
: mBuilder(aReferenceFrame, aMode, aBuildCaret, true)
|
||||
, mList(&mBuilder)
|
||||
{}
|
||||
~RetainedDisplayListBuilder()
|
||||
{
|
||||
|
@ -2611,6 +2611,7 @@ nsDisplayItem* nsDisplayList::RemoveBottom() {
|
||||
nsDisplayItem* item = mSentinel.mAbove;
|
||||
if (!item)
|
||||
return nullptr;
|
||||
MOZ_DIAGNOSTIC_ASSERT(item->mSentinel == 0xDEADBEEFDEADBEEF);
|
||||
mSentinel.mAbove = item->mAbove;
|
||||
if (item == mTop) {
|
||||
// must have been the only item
|
||||
@ -2622,8 +2623,10 @@ nsDisplayItem* nsDisplayList::RemoveBottom() {
|
||||
}
|
||||
|
||||
void nsDisplayList::DeleteAll(nsDisplayListBuilder* aBuilder) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aBuilder == mBuilder);
|
||||
nsDisplayItem* item;
|
||||
while ((item = RemoveBottom()) != nullptr) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aBuilder->DebugContains(item));
|
||||
item->Destroy(aBuilder);
|
||||
}
|
||||
}
|
||||
@ -3512,7 +3515,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
// An auxiliary list is necessary in case we have background blending; if that
|
||||
// is the case, background items need to be wrapped by a blend container to
|
||||
// isolate blending to the background
|
||||
nsDisplayList bgItemList;
|
||||
nsDisplayList bgItemList(aBuilder);
|
||||
// Even if we don't actually have a background color to paint, we may still need
|
||||
// to create an item for hit testing.
|
||||
if ((drawBackgroundColor && color != NS_RGBA(0,0,0,0)) ||
|
||||
@ -3602,7 +3605,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
layer, bgRect, willPaintBorder);
|
||||
}
|
||||
|
||||
nsDisplayList thisItemList;
|
||||
nsDisplayList thisItemList(aBuilder);
|
||||
nsDisplayBackgroundImage::InitData bgData =
|
||||
nsDisplayBackgroundImage::GetInitData(aBuilder, aFrame, i, bgOriginRect, bg,
|
||||
LayerizeFixed::DO_NOT_LAYERIZE_FIXED_BACKGROUND_IF_AVOIDING_COMPONENT_ALPHA_LAYERS);
|
||||
@ -5919,6 +5922,7 @@ nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
|
||||
const ActiveScrolledRoot* aActiveScrolledRoot,
|
||||
bool aClearClipChain)
|
||||
: nsDisplayItem(aBuilder, aFrame, aActiveScrolledRoot)
|
||||
, mList(aBuilder)
|
||||
, mFrameActiveScrolledRoot(aBuilder->CurrentActiveScrolledRoot())
|
||||
, mOverrideZIndex(0)
|
||||
, mHasZIndexOverride(false)
|
||||
@ -5962,6 +5966,7 @@ nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame, nsDisplayItem* aItem)
|
||||
: nsDisplayItem(aBuilder, aFrame)
|
||||
, mList(aBuilder)
|
||||
, mOverrideZIndex(0)
|
||||
, mHasZIndexOverride(false)
|
||||
{
|
||||
@ -6180,7 +6185,7 @@ WrapDisplayList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||
static nsresult
|
||||
WrapEachDisplayItem(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayList* aList, nsDisplayWrapper* aWrapper) {
|
||||
nsDisplayList newList;
|
||||
nsDisplayList newList(aBuilder);
|
||||
nsDisplayItem* item;
|
||||
while ((item = aList->RemoveBottom())) {
|
||||
item = aWrapper->WrapItem(aBuilder, item);
|
||||
@ -7070,7 +7075,7 @@ nsDisplayFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayBackgroundImage* aImage,
|
||||
uint32_t aIndex)
|
||||
{
|
||||
nsDisplayList temp;
|
||||
nsDisplayList temp(aBuilder);
|
||||
temp.AppendToTop(aImage);
|
||||
|
||||
return new (aBuilder) nsDisplayFixedPosition(aBuilder, aFrame, &temp, aIndex + 1);
|
||||
@ -7183,7 +7188,7 @@ nsDisplayTableFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBui
|
||||
uint32_t aIndex,
|
||||
nsIFrame* aAncestorFrame)
|
||||
{
|
||||
nsDisplayList temp;
|
||||
nsDisplayList temp(aBuilder);
|
||||
temp.AppendToTop(aImage);
|
||||
|
||||
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
|
||||
|
@ -674,11 +674,11 @@ public:
|
||||
|
||||
void RecomputeCurrentAnimatedGeometryRoot();
|
||||
|
||||
void Check() {
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
mPool.Check();
|
||||
#endif
|
||||
bool DebugContains(void* aPtr) {
|
||||
return mPool.DebugContains(aPtr);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns true if merging and flattening of display lists should be
|
||||
@ -1832,6 +1832,7 @@ class nsDisplayItemLink {
|
||||
protected:
|
||||
nsDisplayItemLink() : mAbove(nullptr) {}
|
||||
nsDisplayItemLink(const nsDisplayItemLink&) : mAbove(nullptr) {}
|
||||
uint64_t mSentinel = 0xDEADBEEFDEADBEEF;
|
||||
nsDisplayItem* mAbove;
|
||||
|
||||
friend class nsDisplayList;
|
||||
@ -2705,8 +2706,9 @@ public:
|
||||
/**
|
||||
* Create an empty list.
|
||||
*/
|
||||
nsDisplayList()
|
||||
: mLength(0)
|
||||
explicit nsDisplayList(nsDisplayListBuilder* aBuilder)
|
||||
: mBuilder(aBuilder)
|
||||
, mLength(0)
|
||||
, mIsOpaque(false)
|
||||
, mForceTransparentSurface(false)
|
||||
{
|
||||
@ -2726,6 +2728,7 @@ public:
|
||||
void AppendToTop(nsDisplayItem* aItem) {
|
||||
NS_ASSERTION(aItem, "No item to append!");
|
||||
NS_ASSERTION(!aItem->mAbove, "Already in a list!");
|
||||
MOZ_DIAGNOSTIC_ASSERT(mBuilder->DebugContains(aItem));
|
||||
mTop->mAbove = aItem;
|
||||
mTop = aItem;
|
||||
mLength++;
|
||||
@ -2758,6 +2761,7 @@ public:
|
||||
void AppendToBottom(nsDisplayItem* aItem) {
|
||||
NS_ASSERTION(aItem, "No item to append!");
|
||||
NS_ASSERTION(!aItem->mAbove, "Already in a list!");
|
||||
MOZ_DIAGNOSTIC_ASSERT(mBuilder->DebugContains(aItem));
|
||||
aItem->mAbove = mSentinel.mAbove;
|
||||
mSentinel.mAbove = aItem;
|
||||
if (mTop == &mSentinel) {
|
||||
@ -2770,6 +2774,7 @@ public:
|
||||
* Removes all items from aList and appends them to the top of this list
|
||||
*/
|
||||
void AppendToTop(nsDisplayList* aList) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mBuilder == aList->mBuilder);
|
||||
if (aList->mSentinel.mAbove) {
|
||||
mTop->mAbove = aList->mSentinel.mAbove;
|
||||
mTop = aList->mTop;
|
||||
@ -2784,6 +2789,7 @@ public:
|
||||
* Removes all items from aList and prepends them to the bottom of this list
|
||||
*/
|
||||
void AppendToBottom(nsDisplayList* aList) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mBuilder == aList->mBuilder);
|
||||
if (aList->mSentinel.mAbove) {
|
||||
aList->mTop->mAbove = mSentinel.mAbove;
|
||||
mSentinel.mAbove = aList->mSentinel.mAbove;
|
||||
@ -2997,6 +3003,8 @@ public:
|
||||
mForceTransparentSurface = true;
|
||||
}
|
||||
|
||||
nsDisplayListBuilder* mBuilder;
|
||||
|
||||
void RestoreState() {
|
||||
mIsOpaque = false;
|
||||
mForceTransparentSurface = false;
|
||||
@ -3121,10 +3129,24 @@ protected:
|
||||
struct nsDisplayListCollection : public nsDisplayListSet {
|
||||
explicit nsDisplayListCollection(nsDisplayListBuilder* aBuilder) :
|
||||
nsDisplayListSet(&mLists[0], &mLists[1], &mLists[2], &mLists[3], &mLists[4],
|
||||
&mLists[5]) {}
|
||||
&mLists[5]),
|
||||
mLists{ nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder) }
|
||||
{}
|
||||
explicit nsDisplayListCollection(nsDisplayListBuilder* aBuilder, nsDisplayList* aBorderBackground) :
|
||||
nsDisplayListSet(aBorderBackground, &mLists[1], &mLists[2], &mLists[3], &mLists[4],
|
||||
&mLists[5]) {}
|
||||
&mLists[5]),
|
||||
mLists{ nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder),
|
||||
nsDisplayList(aBuilder) }
|
||||
{}
|
||||
|
||||
/**
|
||||
* Sort all lists by content order.
|
||||
@ -4551,6 +4573,7 @@ public:
|
||||
nsDisplayItem* aItem);
|
||||
nsDisplayWrapList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
|
||||
: nsDisplayItem(aBuilder, aFrame)
|
||||
, mList(aBuilder)
|
||||
, mFrameActiveScrolledRoot(aBuilder->CurrentActiveScrolledRoot())
|
||||
, mOverrideZIndex(0)
|
||||
, mHasZIndexOverride(false)
|
||||
@ -4567,6 +4590,7 @@ public:
|
||||
nsDisplayWrapList(const nsDisplayWrapList& aOther) = delete;
|
||||
nsDisplayWrapList(nsDisplayListBuilder* aBuilder, const nsDisplayWrapList& aOther)
|
||||
: nsDisplayItem(aBuilder, aOther)
|
||||
, mList(aOther.mList.mBuilder)
|
||||
, mListPtr(&mList)
|
||||
, mFrameActiveScrolledRoot(aOther.mFrameActiveScrolledRoot)
|
||||
, mMergedFrames(aOther.mMergedFrames)
|
||||
|
@ -783,7 +783,7 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
NS_SVGDisplayListHitTestingEnabled()) ||
|
||||
(!aBuilder->IsForEventDelivery() &&
|
||||
NS_SVGDisplayListPaintingEnabled())) {
|
||||
nsDisplayList newList;
|
||||
nsDisplayList newList(aBuilder);
|
||||
nsDisplayListSet set(&newList, &newList, &newList,
|
||||
&newList, &newList, &newList);
|
||||
BuildDisplayListForNonBlockChildren(aBuilder, set);
|
||||
|
@ -1356,7 +1356,7 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// and merge them into a single Content() list. This can cause us
|
||||
// to violate CSS stacking order, but forceLayer is a magic
|
||||
// XUL-only extension anyway.
|
||||
nsDisplayList masterList;
|
||||
nsDisplayList masterList(aBuilder);
|
||||
masterList.AppendToTop(tempLists.BorderBackground());
|
||||
masterList.AppendToTop(tempLists.BlockBorderBackgrounds());
|
||||
masterList.AppendToTop(tempLists.Floats());
|
||||
|
@ -344,7 +344,7 @@ nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
DisplayListClipState::AutoClipContainingBlockDescendantsToContentBox
|
||||
clip(aBuilder, this, clipFlags);
|
||||
|
||||
nsDisplayList list;
|
||||
nsDisplayList list(aBuilder);
|
||||
list.AppendNewToTop(
|
||||
new (aBuilder) nsDisplayXULImage(aBuilder, this));
|
||||
|
||||
|
@ -446,7 +446,7 @@ nsSliderFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
// This is a bit of a hack. Collect up all descendant display items
|
||||
// and merge them into a single Content() list.
|
||||
nsDisplayList masterList;
|
||||
nsDisplayList masterList(aBuilder);
|
||||
masterList.AppendToTop(tempLists.BorderBackground());
|
||||
masterList.AppendToTop(tempLists.BlockBorderBackgrounds());
|
||||
masterList.AppendToTop(tempLists.Floats());
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "mozilla/MemoryChecking.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/OperatorNewExtensions.h"
|
||||
#include "mozilla/Poison.h"
|
||||
#include "mozilla/TemplateLib.h"
|
||||
#include "nsDebug.h"
|
||||
|
||||
@ -126,11 +125,20 @@ public:
|
||||
|
||||
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
void Check()
|
||||
bool DebugContains(void* aPtr)
|
||||
{
|
||||
for (auto arena = mHead.next; arena; arena = arena->next) {
|
||||
arena->canary.Check();
|
||||
if (arena->DebugContains(aPtr)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
std::stringstream log;
|
||||
log << "Failed to find pointer " << aPtr << " within arena blocks: ";
|
||||
for (ArenaChunk* arena = mHead.next; arena; arena = arena->next) {
|
||||
log << "(" << reinterpret_cast<uintptr_t>(arena + 1) << ", " << arena->header.offset << "), ";
|
||||
}
|
||||
MOZ_CRASH_UNSAFE_OOL(log.str().c_str());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -157,7 +165,6 @@ private:
|
||||
{
|
||||
}
|
||||
|
||||
CorruptionCanary canary;
|
||||
ArenaHeader header;
|
||||
ArenaChunk* next;
|
||||
|
||||
@ -179,6 +186,15 @@ private:
|
||||
size_t Available() const {
|
||||
return header.tail - header.offset;
|
||||
}
|
||||
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
bool DebugContains(void* aPtr)
|
||||
{
|
||||
uintptr_t ptr = reinterpret_cast<uintptr_t>(aPtr);
|
||||
return ptr >= reinterpret_cast<uintptr_t>(this + 1) &&
|
||||
ptr < header.offset;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user