Skip to content

Commit

Permalink
Bug 1425078 - Remove nsDisplayList::AppendNewToTop and nsDisplayList:…
Browse files Browse the repository at this point in the history
…:AppendNewToBottom r=mattwoodrow

MozReview-Commit-ID: E3neKT2sV4Q

--HG--
extra : rebase_source : 98b65e4c82f8a965df211e828bc68d46e7a6716e
  • Loading branch information
mikokm committed Dec 13, 2017
1 parent a499323 commit 2fc0722
Show file tree
Hide file tree
Showing 44 changed files with 122 additions and 142 deletions.
4 changes: 2 additions & 2 deletions layout/base/PresShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5203,7 +5203,7 @@ PresShell::AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
nsIFrame* aFrame,
const nsRect& aBounds)
{
aList.AppendNewToBottom(new (&aBuilder)
aList.AppendToBottom(new (&aBuilder)
nsDisplaySolidColor(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
}

Expand Down Expand Up @@ -5287,7 +5287,7 @@ PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
}

if (!addedScrollingBackgroundColor || forceUnscrolledItem) {
aList.AppendNewToBottom(
aList.AppendToBottom(
new (&aBuilder) nsDisplaySolidColor(&aBuilder, aFrame, aBounds, bgcolor));
}
}
Expand Down
6 changes: 3 additions & 3 deletions layout/forms/nsButtonFrameRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
nsDisplayList* aForeground)
{
if (mFrame->StyleEffects()->mBoxShadow) {
aBackground->AppendNewToTop(new (aBuilder)
aBackground->AppendToTop(new (aBuilder)
nsDisplayButtonBoxShadowOuter(aBuilder, this));
}

Expand All @@ -498,13 +498,13 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, mFrame, buttonRect, aBackground);

aBackground->AppendNewToTop(new (aBuilder)
aBackground->AppendToTop(new (aBuilder)
nsDisplayButtonBorder(aBuilder, this));

// Only display focus rings if we actually have them. Since at most one
// button would normally display a focus ring, most buttons won't have them.
if (mInnerFocusStyle && mInnerFocusStyle->StyleBorder()->HasBorder()) {
aForeground->AppendNewToTop(new (aBuilder)
aForeground->AppendToTop(new (aBuilder)
nsDisplayButtonForeground(aBuilder, this));
}
return NS_OK;
Expand Down
2 changes: 1 addition & 1 deletion layout/forms/nsComboboxControlFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if ((!IsThemed(disp) ||
!presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
mDisplayFrame && IsVisibleForPainting(aBuilder)) {
aLists.Content()->AppendNewToTop(
aLists.Content()->AppendToTop(
new (aBuilder) nsDisplayComboboxFocus(aBuilder, this));
}
}
Expand Down
4 changes: 2 additions & 2 deletions layout/forms/nsFieldSetFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!(GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) &&
IsVisibleForPainting(aBuilder)) {
if (StyleEffects()->mBoxShadow) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayBoxShadowOuter(aBuilder, this));
}

Expand All @@ -205,7 +205,7 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aLists.BorderBackground(),
/* aAllowWillPaintBorderOptimization = */ false);

aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayFieldSetBorder(aBuilder, this));

DisplayOutlineUnconditional(aBuilder, aLists);
Expand Down
2 changes: 1 addition & 1 deletion layout/forms/nsListControlFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// XXX Because we have an opaque widget and we get called to paint with
// this frame as the root of a stacking context we need make sure to draw
// some opaque color over the whole widget. (Bug 511323)
aLists.BorderBackground()->AppendNewToBottom(
aLists.BorderBackground()->AppendToBottom(
new (aBuilder) nsDisplaySolidColor(aBuilder,
this, nsRect(aBuilder->ToReferenceFrame(this), GetSize()),
mLastDropdownBackstopColor));
Expand Down
2 changes: 1 addition & 1 deletion layout/forms/nsRangeFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return; // the native theme displays its own visual indication of focus
}

aLists.Content()->AppendNewToTop(
aLists.Content()->AppendToTop(
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
}

Expand Down
2 changes: 1 addition & 1 deletion layout/forms/nsSelectsAreaFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
// we can't just associate the display item with the list frame,
// because then the list's scrollframe won't clip it (the scrollframe
// only clips contained descendants).
aLists.Outlines()->AppendNewToTop(new (aBuilder)
aLists.Outlines()->AppendToTop(new (aBuilder)
nsDisplayListFocus(aBuilder, this));
}
}
Expand Down
4 changes: 2 additions & 2 deletions layout/generic/TextOverflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
nsDisplayItem* marker = new (mBuilder)
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
aLine->GetLogicalAscent(), mIStart.mStyle, aLineNumber, 0);
mMarkerList.AppendNewToTop(marker);
mMarkerList.AppendToTop(marker);
}

if (aCreateIEnd) {
Expand All @@ -875,7 +875,7 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
nsDisplayItem* marker = new (mBuilder)
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
aLine->GetLogicalAscent(), mIEnd.mStyle, aLineNumber, 1);
mMarkerList.AppendNewToTop(marker);
mMarkerList.AppendToTop(marker);
}
}

Expand Down
2 changes: 1 addition & 1 deletion layout/generic/ViewportFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
new (aBuilder) nsDisplayWrapList(aBuilder, this, &topLayerList);
wrapList->SetOverrideZIndex(
std::numeric_limits<decltype(wrapList->ZIndex())>::max());
aLists.PositionedDescendants()->AppendNewToTop(wrapList);
aLists.PositionedDescendants()->AppendToTop(wrapList);
}
}

Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsBulletFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,

DO_GLOBAL_REFLOW_COUNT_DSP("nsBulletFrame");

aLists.Content()->AppendNewToTop(
aLists.Content()->AppendToTop(
new (aBuilder) nsDisplayBullet(aBuilder, this));
}

Expand Down
14 changes: 7 additions & 7 deletions layout/generic/nsCanvasFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,11 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
dependentFrame = nullptr;
}
}
aLists.BorderBackground()->AppendNewToTop(
aLists.BorderBackground()->AppendToTop(
new (aBuilder) nsDisplayCanvasBackgroundColor(aBuilder, this));

if (isThemed) {
aLists.BorderBackground()->AppendNewToTop(
aLists.BorderBackground()->AppendToTop(
new (aBuilder) nsDisplayCanvasThemedBackground(aBuilder, this));
return;
}
Expand Down Expand Up @@ -571,18 +571,18 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(bgData);
bgItem->SetDependentFrame(aBuilder, dependentFrame);
}
thisItemList.AppendNewToTop(
thisItemList.AppendToTop(
nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, this, bgItem, i));

} else {
nsDisplayCanvasBackgroundImage* bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(bgData);
bgItem->SetDependentFrame(aBuilder, dependentFrame);
thisItemList.AppendNewToTop(bgItem);
thisItemList.AppendToTop(bgItem);
}

if (layers.mLayers[i].mBlendMode != NS_STYLE_BLEND_NORMAL) {
DisplayListClipState::AutoSaveRestore blendClip(aBuilder);
thisItemList.AppendNewToTop(
thisItemList.AppendToTop(
new (aBuilder) nsDisplayBlendMode(aBuilder, this, &thisItemList,
layers.mLayers[i].mBlendMode,
thisItemASR, i + 1));
Expand All @@ -593,7 +593,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (needBlendContainer) {
const ActiveScrolledRoot* containerASR = contASRTracker.GetContainerASR();
DisplayListClipState::AutoSaveRestore blendContainerClip(aBuilder);
aLists.BorderBackground()->AppendNewToTop(
aLists.BorderBackground()->AppendToTop(
nsDisplayBlendContainer::CreateForBackgroundBlendMode(aBuilder, this,
aLists.BorderBackground(),
containerASR));
Expand Down Expand Up @@ -631,7 +631,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!StyleVisibility()->IsVisible())
return;

aLists.Outlines()->AppendNewToTop(new (aBuilder)
aLists.Outlines()->AppendToTop(new (aBuilder)
nsDisplayCanvasFocus(aBuilder, this));
}

Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsColumnSetFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,

if (IsVisibleForPainting(aBuilder)) {
aLists.BorderBackground()->
AppendNewToTop(new (aBuilder) nsDisplayColumnRule(aBuilder, this));
AppendToTop(new (aBuilder) nsDisplayColumnRule(aBuilder, this));
}

// Our children won't have backgrounds so it doesn't matter where we put them.
Expand Down
Loading

0 comments on commit 2fc0722

Please sign in to comment.