mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas
This commit is contained in:
parent
df0359273e
commit
e485bba27f
@ -5222,8 +5222,8 @@ PresShell::AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
|
||||
nsIFrame* aFrame,
|
||||
const nsRect& aBounds)
|
||||
{
|
||||
aList.AppendToBottom(new (&aBuilder)
|
||||
nsDisplaySolidColor(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
|
||||
aList.AppendToBottom(
|
||||
MakeDisplayItem<nsDisplaySolidColor>(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -5313,7 +5313,7 @@ PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
|
||||
|
||||
if (!addedScrollingBackgroundColor || forceUnscrolledItem) {
|
||||
aList.AppendToBottom(
|
||||
new (&aBuilder) nsDisplaySolidColor(&aBuilder, aFrame, aBounds, bgcolor));
|
||||
MakeDisplayItem<nsDisplaySolidColor>(&aBuilder, aFrame, aBounds, bgcolor));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3021,7 +3021,7 @@ nsLayoutUtils::GetLayerTransformForFrame(nsIFrame* aFrame,
|
||||
builder.BeginFrame();
|
||||
nsDisplayList list;
|
||||
nsDisplayTransform* item =
|
||||
new (&builder) nsDisplayTransform(&builder, aFrame, &list, nsRect());
|
||||
MakeDisplayItem<nsDisplayTransform>(&builder, aFrame, &list, nsRect());
|
||||
|
||||
*aTransform = item->GetTransform();
|
||||
item->Destroy(&builder);
|
||||
|
@ -477,8 +477,8 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayList* aForeground)
|
||||
{
|
||||
if (mFrame->StyleEffects()->mBoxShadow) {
|
||||
aBackground->AppendToTop(new (aBuilder)
|
||||
nsDisplayButtonBoxShadowOuter(aBuilder, this));
|
||||
aBackground->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayButtonBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsRect buttonRect = mFrame->GetRectRelativeToSelf();
|
||||
@ -486,14 +486,14 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, mFrame, buttonRect, aBackground);
|
||||
|
||||
aBackground->AppendToTop(new (aBuilder)
|
||||
nsDisplayButtonBorder(aBuilder, this));
|
||||
aBackground->AppendToTop(
|
||||
MakeDisplayItem<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->AppendToTop(new (aBuilder)
|
||||
nsDisplayButtonForeground(aBuilder, this));
|
||||
aForeground->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayButtonForeground>(aBuilder, this));
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1599,7 +1599,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
!presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
|
||||
mDisplayFrame && IsVisibleForPainting(aBuilder)) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayComboboxFocus(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayComboboxFocus>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -196,8 +196,8 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (!(GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) &&
|
||||
IsVisibleForPainting(aBuilder)) {
|
||||
if (StyleEffects()->mBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBoxShadowOuter(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
@ -205,8 +205,8 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
aLists.BorderBackground(),
|
||||
/* aAllowWillPaintBorderOptimization = */ false);
|
||||
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayFieldSetBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayFieldSetBorder>(aBuilder, this));
|
||||
|
||||
DisplayOutlineUnconditional(aBuilder, aLists);
|
||||
|
||||
|
@ -185,7 +185,7 @@ nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// 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()->AppendToBottom(
|
||||
new (aBuilder) nsDisplaySolidColor(aBuilder,
|
||||
MakeDisplayItem<nsDisplaySolidColor>(aBuilder,
|
||||
this, nsRect(aBuilder->ToReferenceFrame(this), GetSize()),
|
||||
mLastDropdownBackstopColor));
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayRangeFocusRing>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -75,11 +75,11 @@ public:
|
||||
nsOptionEventGrabberWrapper() {}
|
||||
virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame, nsDisplayList* aList) override {
|
||||
return new (aBuilder) nsDisplayOptionEventGrabber(aBuilder, aFrame, aList);
|
||||
return MakeDisplayItem<nsDisplayOptionEventGrabber>(aBuilder, aFrame, aList);
|
||||
}
|
||||
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayItem* aItem) override {
|
||||
return new (aBuilder) nsDisplayOptionEventGrabber(aBuilder, aItem->Frame(), aItem);
|
||||
return MakeDisplayItem<nsDisplayOptionEventGrabber>(aBuilder, aItem->Frame(), aItem);
|
||||
}
|
||||
};
|
||||
|
||||
@ -154,8 +154,8 @@ 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()->AppendToTop(new (aBuilder)
|
||||
nsDisplayListFocus(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayListFocus>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -861,9 +861,10 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
|
||||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
|
||||
ClipMarker(aContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
|
||||
markerRect, clipState);
|
||||
nsDisplayItem* marker = new (mBuilder)
|
||||
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIStart.mStyle, aLineNumber, 0);
|
||||
nsDisplayItem* marker =
|
||||
MakeDisplayItem<nsDisplayTextOverflowMarker>(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIStart.mStyle,
|
||||
aLineNumber, 0);
|
||||
mMarkerList.AppendToTop(marker);
|
||||
}
|
||||
|
||||
@ -878,9 +879,10 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
|
||||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
|
||||
ClipMarker(aContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
|
||||
markerRect, clipState);
|
||||
nsDisplayItem* marker = new (mBuilder)
|
||||
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIEnd.mStyle, aLineNumber, 1);
|
||||
nsDisplayItem* marker =
|
||||
MakeDisplayItem<nsDisplayTextOverflowMarker>(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIEnd.mStyle,
|
||||
aLineNumber, 1);
|
||||
mMarkerList.AppendToTop(marker);
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// Wrap the whole top layer in a single item with maximum z-index,
|
||||
// and append it at the very end, so that it stays at the topmost.
|
||||
nsDisplayWrapList* wrapList =
|
||||
new (aBuilder) nsDisplayWrapList(aBuilder, this, &topLayerList);
|
||||
MakeDisplayItem<nsDisplayWrapList>(aBuilder, this, &topLayerList);
|
||||
wrapList->SetOverrideZIndex(
|
||||
std::numeric_limits<decltype(wrapList->ZIndex())>::max());
|
||||
aLists.PositionedDescendants()->AppendToTop(wrapList);
|
||||
|
@ -789,7 +789,7 @@ nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsBulletFrame");
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBullet(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayBullet>(aBuilder, this));
|
||||
}
|
||||
|
||||
Maybe<BulletRenderer>
|
||||
|
@ -470,11 +470,11 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
}
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayCanvasBackgroundColor(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayCanvasBackgroundColor>(aBuilder, this));
|
||||
|
||||
if (isThemed) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayCanvasThemedBackground(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayCanvasThemedBackground>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -528,14 +528,14 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
{
|
||||
DisplayListClipState::AutoSaveRestore bgImageClip(aBuilder);
|
||||
bgImageClip.Clear();
|
||||
bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(bgData);
|
||||
bgItem = MakeDisplayItem<nsDisplayCanvasBackgroundImage>(aBuilder, bgData);
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
}
|
||||
thisItemList.AppendToTop(
|
||||
nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, this, bgItem, i));
|
||||
|
||||
} else {
|
||||
nsDisplayCanvasBackgroundImage* bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(bgData);
|
||||
nsDisplayCanvasBackgroundImage* bgItem = MakeDisplayItem<nsDisplayCanvasBackgroundImage>(aBuilder, bgData);
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
thisItemList.AppendToTop(bgItem);
|
||||
}
|
||||
@ -543,9 +543,9 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (layers.mLayers[i].mBlendMode != NS_STYLE_BLEND_NORMAL) {
|
||||
DisplayListClipState::AutoSaveRestore blendClip(aBuilder);
|
||||
thisItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayBlendMode(aBuilder, this, &thisItemList,
|
||||
layers.mLayers[i].mBlendMode,
|
||||
thisItemASR, i + 1));
|
||||
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, this, &thisItemList,
|
||||
layers.mLayers[i].mBlendMode,
|
||||
thisItemASR, i + 1));
|
||||
}
|
||||
aLists.BorderBackground()->AppendToTop(&thisItemList);
|
||||
}
|
||||
@ -591,8 +591,8 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (!StyleVisibility()->IsVisible())
|
||||
return;
|
||||
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayCanvasFocus(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayCanvasFocus>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -190,8 +190,8 @@ public:
|
||||
|
||||
class nsDisplayCanvasBackgroundImage : public nsDisplayBackgroundImage {
|
||||
public:
|
||||
explicit nsDisplayCanvasBackgroundImage(const InitData& aInitData)
|
||||
: nsDisplayBackgroundImage(aInitData)
|
||||
explicit nsDisplayCanvasBackgroundImage(nsDisplayListBuilder* aBuilder, const InitData& aInitData)
|
||||
: nsDisplayBackgroundImage(aBuilder, aInitData)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1280,7 +1280,7 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (IsVisibleForPainting(aBuilder)) {
|
||||
aLists.BorderBackground()->
|
||||
AppendToTop(new (aBuilder) nsDisplayColumnRule(aBuilder, this));
|
||||
AppendToTop(MakeDisplayItem<nsDisplayColumnRule>(aBuilder, this));
|
||||
}
|
||||
|
||||
// Our children won't have backgrounds so it doesn't matter where we put them.
|
||||
|
@ -2318,8 +2318,8 @@ nsFrame::DisplaySelectionOverlay(nsDisplayListBuilder* aBuilder,
|
||||
return;
|
||||
}
|
||||
|
||||
aList->AppendToTop(new (aBuilder)
|
||||
nsDisplaySelectionOverlay(aBuilder, this, selectionValue));
|
||||
aList->AppendToTop(
|
||||
MakeDisplayItem<nsDisplaySelectionOverlay>(aBuilder, this, selectionValue));
|
||||
}
|
||||
|
||||
void
|
||||
@ -2331,7 +2331,7 @@ nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
aLists.Outlines()->AppendToTop(
|
||||
new (aBuilder) nsDisplayOutline(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayOutline>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
@ -2351,7 +2351,7 @@ nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder,
|
||||
if (!IsVisibleForPainting(aBuilder))
|
||||
return;
|
||||
|
||||
aList->AppendToTop(new (aBuilder) nsDisplayCaret(aBuilder, this));
|
||||
aList->AppendToTop(MakeDisplayItem<nsDisplayCaret>(aBuilder, this));
|
||||
}
|
||||
|
||||
nscolor
|
||||
@ -2390,23 +2390,23 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsCSSShadowArray* shadows = StyleEffects()->mBoxShadow;
|
||||
if (shadows && shadows->HasShadowWithInset(false)) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBoxShadowOuter(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
bool bgIsThemed = DisplayBackgroundUnconditional(aBuilder, aLists,
|
||||
aForceBackground);
|
||||
|
||||
if (shadows && shadows->HasShadowWithInset(true)) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBoxShadowInner(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, this));
|
||||
}
|
||||
|
||||
// If there's a themed background, we should not create a border item.
|
||||
// It won't be rendered.
|
||||
if (!bgIsThemed && StyleBorder()->HasBorder()) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBorder>(aBuilder, this));
|
||||
}
|
||||
|
||||
DisplayOutlineUnconditional(aBuilder, aLists);
|
||||
@ -2541,16 +2541,16 @@ DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||
// Draw a border around the child
|
||||
// REVIEW: From nsContainerFrame::PaintChild
|
||||
if (nsFrame::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) {
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, aFrame, PaintDebugBorder, "DebugBorder",
|
||||
DisplayItemType::TYPE_DEBUG_BORDER));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, aFrame, PaintDebugBorder, "DebugBorder",
|
||||
DisplayItemType::TYPE_DEBUG_BORDER));
|
||||
}
|
||||
// Draw a border around the current event target
|
||||
if (nsFrame::GetShowEventTargetFrameBorder() &&
|
||||
aFrame->PresShell()->GetDrawEventTargetFrame() == aFrame) {
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
|
||||
DisplayItemType::TYPE_EVENT_TARGET_BORDER));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
|
||||
DisplayItemType::TYPE_EVENT_TARGET_BORDER));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -2654,7 +2654,7 @@ WrapSeparatorTransform(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||
int aIndex) {
|
||||
if (!aSource->IsEmpty()) {
|
||||
nsDisplayTransform *sepIdItem =
|
||||
new (aBuilder) nsDisplayTransform(aBuilder, aFrame, aSource,
|
||||
MakeDisplayItem<nsDisplayTransform>(aBuilder, aFrame, aSource,
|
||||
aBuilder->GetVisibleRect(), Matrix4x4(), aIndex);
|
||||
sepIdItem->SetNoExtendContext();
|
||||
aTarget->AppendToTop(sepIdItem);
|
||||
@ -3031,7 +3031,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsDisplayLayerEventRegions* eventRegions = nullptr;
|
||||
if (aBuilder->IsBuildingLayerEventRegions()) {
|
||||
eventRegions = new (aBuilder) nsDisplayLayerEventRegions(aBuilder, this);
|
||||
eventRegions = MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, this);
|
||||
eventRegions->AddFrame(aBuilder, this);
|
||||
aBuilder->SetLayerEventRegions(eventRegions);
|
||||
}
|
||||
@ -3072,7 +3072,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (eventRegions) {
|
||||
eventRegions->Destroy(aBuilder);
|
||||
eventRegions = new (aBuilder) nsDisplayLayerEventRegions(aBuilder, this);
|
||||
eventRegions = MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, this);
|
||||
eventRegions->AddFrame(aBuilder, this);
|
||||
aBuilder->SetLayerEventRegions(eventRegions);
|
||||
}
|
||||
@ -3116,7 +3116,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (hasOverrideDirtyRect && gfxPrefs::LayoutDisplayListShowArea()) {
|
||||
nsDisplaySolidColor* color =
|
||||
new (aBuilder) nsDisplaySolidColor(aBuilder, this,
|
||||
MakeDisplayItem<nsDisplaySolidColor>(aBuilder, this,
|
||||
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
|
||||
NS_RGBA(255, 0, 0, 64), false);
|
||||
color->SetOverrideZIndex(INT32_MAX);
|
||||
@ -3219,7 +3219,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
/* List now emptied, so add the new list to the top. */
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayFilter(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayFilter>(aBuilder, this, &resultList,
|
||||
handleOpacity));
|
||||
}
|
||||
|
||||
@ -3239,7 +3239,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
: containerItemASR;
|
||||
/* List now emptied, so add the new list to the top. */
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayMask(aBuilder, this, &resultList, !useOpacity,
|
||||
MakeDisplayItem<nsDisplayMask>(aBuilder, this, &resultList, !useOpacity,
|
||||
maskASR));
|
||||
}
|
||||
|
||||
@ -3261,7 +3261,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
// all descendant content, but some should not be clipped.
|
||||
DisplayListClipState::AutoSaveRestore opacityClipState(aBuilder);
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayOpacity(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayOpacity>(aBuilder, this, &resultList,
|
||||
containerItemASR,
|
||||
opacityItemForEventsAndPluginsOnly));
|
||||
if (aCreatedContainerItem) {
|
||||
@ -3327,7 +3327,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
GetOffsetToCrossDoc(outerReferenceFrame));
|
||||
|
||||
nsDisplayTransform *transformItem =
|
||||
new (aBuilder) nsDisplayTransform(aBuilder, this,
|
||||
MakeDisplayItem<nsDisplayTransform>(aBuilder, this,
|
||||
&resultList, visibleRect, 0,
|
||||
allowAsyncAnimation);
|
||||
resultList.AppendToTop(transformItem);
|
||||
@ -3337,7 +3337,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
clipState.Restore();
|
||||
}
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayPerspective(
|
||||
MakeDisplayItem<nsDisplayPerspective>(
|
||||
aBuilder, this,
|
||||
GetContainingBlock(0, disp)->GetContent()->GetPrimaryFrame(),
|
||||
&resultList));
|
||||
@ -3351,7 +3351,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
if (clipCapturedBy == ContainerItemType::eOwnLayerForTransformWithRoundedClip) {
|
||||
clipState.Restore();
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayOwnLayer(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &resultList,
|
||||
aBuilder->CurrentActiveScrolledRoot(),
|
||||
nsDisplayOwnLayerFlags::eNone,
|
||||
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
|
||||
@ -3374,7 +3374,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
const ActiveScrolledRoot* fixedASR =
|
||||
ActiveScrolledRoot::PickAncestor(containerItemASR, aBuilder->CurrentActiveScrolledRoot());
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayFixedPosition(aBuilder, this, &resultList, fixedASR));
|
||||
MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, this, &resultList, fixedASR));
|
||||
if (aCreatedContainerItem) {
|
||||
*aCreatedContainerItem = true;
|
||||
}
|
||||
@ -3390,7 +3390,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
const ActiveScrolledRoot* stickyASR =
|
||||
ActiveScrolledRoot::PickAncestor(containerItemASR, aBuilder->CurrentActiveScrolledRoot());
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayStickyPosition(aBuilder, this, &resultList, stickyASR));
|
||||
MakeDisplayItem<nsDisplayStickyPosition>(aBuilder, this, &resultList, stickyASR));
|
||||
if (aCreatedContainerItem) {
|
||||
*aCreatedContainerItem = true;
|
||||
}
|
||||
@ -3404,7 +3404,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
if (useBlendMode) {
|
||||
DisplayListClipState::AutoSaveRestore blendModeClipState(aBuilder);
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayBlendMode(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, this, &resultList,
|
||||
effects->mMixBlendMode,
|
||||
containerItemASR));
|
||||
if (aCreatedContainerItem) {
|
||||
@ -3436,7 +3436,7 @@ WrapInWrapList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
// Clear clip rect for the construction of the items below. Since we're
|
||||
// clipping all their contents, they themselves don't need to be clipped.
|
||||
return new (aBuilder) nsDisplayWrapList(aBuilder, aFrame, aList, aContainerASR, true);
|
||||
return MakeDisplayItem<nsDisplayWrapList>(aBuilder, aFrame, aList, aContainerASR, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3777,7 +3777,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||
// make sure we accumulate event regions for its layer.
|
||||
if (buildingForChild.IsAnimatedGeometryRoot() || isPositioned) {
|
||||
nsDisplayLayerEventRegions* eventRegions =
|
||||
new (aBuilder) nsDisplayLayerEventRegions(aBuilder, child);
|
||||
MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, child);
|
||||
eventRegions->AddFrame(aBuilder, child);
|
||||
aBuilder->SetLayerEventRegions(eventRegions);
|
||||
|
||||
@ -10966,8 +10966,8 @@ nsIFrame::CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder,
|
||||
if (GetContent() &&
|
||||
GetContent()->IsXULElement() &&
|
||||
GetContent()->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::layer)) {
|
||||
aList->AppendToTop(new (aBuilder)
|
||||
nsDisplayOwnLayer(aBuilder, this, aList, aBuilder->CurrentActiveScrolledRoot()));
|
||||
aList->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, aList, aBuilder->CurrentActiveScrolledRoot()));
|
||||
if (aCreatedContainerItem) {
|
||||
*aCreatedContainerItem = true;
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ nsHTMLFramesetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (mDragger && aBuilder->IsForEventDelivery()) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1425,7 +1425,7 @@ nsHTMLFramesetBorderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayFramesetBorder(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayFramesetBorder>(aBuilder, this));
|
||||
}
|
||||
|
||||
void nsHTMLFramesetBorderFrame::PaintBorder(DrawTarget* aDrawTarget,
|
||||
@ -1636,5 +1636,5 @@ nsHTMLFramesetBlankFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayFramesetBlank(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayFramesetBlank>(aBuilder, this));
|
||||
}
|
||||
|
@ -3072,9 +3072,9 @@ AppendToTop(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists,
|
||||
flags |= nsDisplayOwnLayerFlags::eScrollbarContainer;
|
||||
}
|
||||
|
||||
newItem = new (aBuilder) nsDisplayOwnLayer(aBuilder, aSourceFrame, aSource, asr, flags, scrollTarget);
|
||||
newItem = MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, aSourceFrame, aSource, asr, flags, scrollTarget);
|
||||
} else {
|
||||
newItem = new (aBuilder) nsDisplayWrapList(aBuilder, aSourceFrame, aSource, asr);
|
||||
newItem = MakeDisplayItem<nsDisplayWrapList>(aBuilder, aSourceFrame, aSource, asr);
|
||||
}
|
||||
|
||||
if (aFlags & APPEND_POSITIONED) {
|
||||
@ -3618,9 +3618,9 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (dirtyRectHasBeenOverriden && gfxPrefs::LayoutDisplayListShowArea()) {
|
||||
nsDisplaySolidColor* color =
|
||||
new (aBuilder) nsDisplaySolidColor(aBuilder, mOuter,
|
||||
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
|
||||
NS_RGBA(0, 0, 255, 64), false);
|
||||
MakeDisplayItem<nsDisplaySolidColor>(aBuilder, mOuter,
|
||||
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
|
||||
NS_RGBA(0, 0, 255, 64), false);
|
||||
color->SetOverrideZIndex(INT32_MAX);
|
||||
scrolledContent.PositionedDescendants()->AppendToTop(color);
|
||||
}
|
||||
@ -3684,13 +3684,13 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
CompositorHitTestInfo info = CompositorHitTestInfo::eVisibleToHitTest
|
||||
| CompositorHitTestInfo::eDispatchToContent;
|
||||
nsDisplayCompositorHitTestInfo* hitInfo =
|
||||
new (aBuilder) nsDisplayCompositorHitTestInfo(aBuilder, mScrolledFrame, info, 1,
|
||||
MakeDisplayItem<nsDisplayCompositorHitTestInfo>(aBuilder, mScrolledFrame, info, 1,
|
||||
Some(mScrollPort + aBuilder->ToReferenceFrame(mOuter)));
|
||||
AppendInternalItemToTop(scrolledContent, hitInfo, zIndex);
|
||||
}
|
||||
if (aBuilder->IsBuildingLayerEventRegions()) {
|
||||
nsDisplayLayerEventRegions* inactiveRegionItem =
|
||||
new (aBuilder) nsDisplayLayerEventRegions(aBuilder, mScrolledFrame, 1);
|
||||
MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, mScrolledFrame, 1);
|
||||
inactiveRegionItem->AddInactiveScrollPort(mScrolledFrame, mScrollPort + aBuilder->ToReferenceFrame(mOuter));
|
||||
AppendInternalItemToTop(scrolledContent, inactiveRegionItem, zIndex);
|
||||
}
|
||||
@ -3698,7 +3698,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (aBuilder->ShouldBuildScrollInfoItemsForHoisting()) {
|
||||
aBuilder->AppendNewScrollInfoItemForHoisting(
|
||||
new (aBuilder) nsDisplayScrollInfoLayer(aBuilder, mScrolledFrame,
|
||||
MakeDisplayItem<nsDisplayScrollInfoLayer>(aBuilder, mScrolledFrame,
|
||||
mOuter));
|
||||
}
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ nsHTMLCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
clip(aBuilder, this, clipFlags);
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayCanvas(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayCanvas>(aBuilder, this));
|
||||
|
||||
DisplaySelectionOverlay(aBuilder, aLists.Content(),
|
||||
nsISelectionDisplay::DISPLAY_IMAGES);
|
||||
|
@ -1849,8 +1849,8 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (!imageOK || !mImage || !SizeIsAvailable(currentRequest)) {
|
||||
// No image yet, or image load failed. Draw the alt-text and an icon
|
||||
// indicating the status
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayAltFeedback(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayAltFeedback>(aBuilder, this));
|
||||
|
||||
// This image is visible (we are being asked to paint it) but it's not
|
||||
// decoded yet. And we are not going to ask the image to draw, so this
|
||||
@ -1867,8 +1867,8 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayImage(aBuilder, this, mImage, mPrevImage));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayImage>(aBuilder, this, mImage, mPrevImage));
|
||||
|
||||
// If we were previously displaying an icon, we're not anymore
|
||||
if (mDisplayingIcon) {
|
||||
@ -1878,9 +1878,9 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
#ifdef DEBUG
|
||||
if (GetShowFrameBorders() && GetImageMap()) {
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, this, PaintDebugImageMap, "DebugImageMap",
|
||||
DisplayItemType::TYPE_DEBUG_IMAGE_MAP));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintDebugImageMap, "DebugImageMap",
|
||||
DisplayItemType::TYPE_DEBUG_IMAGE_MAP));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -586,14 +586,14 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
*aBuilder, content, child, backgroundRect, NS_RGBA(0,0,0,0));
|
||||
}
|
||||
|
||||
content.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, child,
|
||||
content.AppendToTop(MakeDisplayItem<nsDisplayTransform>(aBuilder, child,
|
||||
&content, content.GetVisibleRect(), ::ComputePageTransform));
|
||||
|
||||
set.Content()->AppendToTop(&content);
|
||||
|
||||
if (PresContext()->IsRootPaginatedDocument()) {
|
||||
set.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayHeaderFooter(aBuilder, this));
|
||||
set.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayHeaderFooter>(aBuilder, this));
|
||||
}
|
||||
|
||||
set.MoveTo(aLists);
|
||||
|
@ -273,9 +273,9 @@ nsPlaceholderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
#ifdef DEBUG
|
||||
if (GetShowFrameBorders()) {
|
||||
aLists.Outlines()->AppendToTop(
|
||||
new (aBuilder) nsDisplayGeneric(aBuilder, this, PaintDebugPlaceholder,
|
||||
"DebugPlaceholder",
|
||||
DisplayItemType::TYPE_DEBUG_PLACEHOLDER));
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintDebugPlaceholder,
|
||||
"DebugPlaceholder",
|
||||
DisplayItemType::TYPE_DEBUG_PLACEHOLDER));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1187,9 +1187,9 @@ nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
// determine if we are printing
|
||||
if (type == nsPresContext::eContext_Print) {
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, this, PaintPrintPlugin, "PrintPlugin",
|
||||
DisplayItemType::TYPE_PRINT_PLUGIN));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintPrintPlugin, "PrintPlugin",
|
||||
DisplayItemType::TYPE_PRINT_PLUGIN));
|
||||
} else {
|
||||
LayerState state = GetLayerState(aBuilder, nullptr);
|
||||
if (state == LAYER_INACTIVE &&
|
||||
@ -1199,12 +1199,12 @@ nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (aBuilder->IsPaintingToWindow() &&
|
||||
state == LAYER_ACTIVE &&
|
||||
IsTransparentMode()) {
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayPluginReadback(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayPluginReadback>(aBuilder, this));
|
||||
}
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayPlugin(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayPlugin>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -747,9 +747,9 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
}
|
||||
|
||||
content.AppendToTop(new (aBuilder)
|
||||
nsDisplayTransform(aBuilder, this, &content, content.GetVisibleRect(),
|
||||
::ComputePageSequenceTransform));
|
||||
content.AppendToTop(
|
||||
MakeDisplayItem<nsDisplayTransform>(aBuilder, this, &content, content.GetVisibleRect(),
|
||||
::ComputePageSequenceTransform));
|
||||
|
||||
aLists.Content()->AppendToTop(&content);
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ WrapBackgroundColorInOwnLayer(nsDisplayListBuilder* aBuilder,
|
||||
if (item->GetType() == DisplayItemType::TYPE_BACKGROUND_COLOR) {
|
||||
nsDisplayList tmpList;
|
||||
tmpList.AppendToTop(item);
|
||||
item = new (aBuilder) nsDisplayOwnLayer(aBuilder, aFrame, &tmpList, aBuilder->CurrentActiveScrolledRoot());
|
||||
item = MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, aFrame, &tmpList, aBuilder->CurrentActiveScrolledRoot());
|
||||
}
|
||||
tempItems.AppendToTop(item);
|
||||
}
|
||||
@ -558,7 +558,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
zoomFlags |= nsDisplayOwnLayerFlags::eGenerateScrollableLayer;
|
||||
}
|
||||
nsDisplayZoom* zoomItem =
|
||||
new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems,
|
||||
MakeDisplayItem<nsDisplayZoom>(aBuilder, subdocRootFrame, &childItems,
|
||||
subdocAPD, parentAPD, zoomFlags);
|
||||
childItems.AppendToTop(zoomItem);
|
||||
needsOwnLayer = false;
|
||||
@ -570,14 +570,14 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
if (constructResolutionItem) {
|
||||
nsDisplayResolution* resolutionItem =
|
||||
new (aBuilder) nsDisplayResolution(aBuilder, subdocRootFrame, &childItems,
|
||||
flags);
|
||||
MakeDisplayItem<nsDisplayResolution>(aBuilder, subdocRootFrame, &childItems,
|
||||
flags);
|
||||
childItems.AppendToTop(resolutionItem);
|
||||
needsOwnLayer = false;
|
||||
}
|
||||
|
||||
// We always want top level content documents to be in their own layer.
|
||||
nsDisplaySubDocument* layerItem = new (aBuilder) nsDisplaySubDocument(
|
||||
nsDisplaySubDocument* layerItem = MakeDisplayItem<nsDisplaySubDocument>(
|
||||
aBuilder, subdocRootFrame ? subdocRootFrame : this, this,
|
||||
&childItems, flags);
|
||||
childItems.AppendToTop(layerItem);
|
||||
|
@ -5237,7 +5237,7 @@ nsTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayText(aBuilder, this, isSelected));
|
||||
MakeDisplayItem<nsDisplayText>(aBuilder, this, isSelected));
|
||||
}
|
||||
|
||||
static nsIFrame*
|
||||
|
@ -570,7 +570,7 @@ nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (HasVideoElement() && !shouldDisplayPoster) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayVideo(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayVideo>(aBuilder, this));
|
||||
}
|
||||
|
||||
// Add child frames to display list. We expect various children,
|
||||
|
@ -294,7 +294,7 @@ RenderFrameParent::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
clipState.ClipContentDescendants(bounds);
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayRemote(aBuilder, aFrame, this));
|
||||
MakeDisplayItem<nsDisplayRemote>(aBuilder, aFrame, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1988,8 +1988,8 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
|
||||
// purposes. Normally, users will set the background on the container frame.
|
||||
// paint the selection background -- beware MathML frames overlap a lot
|
||||
if (aSelectedRect && !aSelectedRect->IsEmpty()) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLSelectionRect(aBuilder, aForFrame, *aSelectedRect));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLSelectionRect>(aBuilder, aForFrame, *aSelectedRect));
|
||||
}
|
||||
else if (mRect.width && mRect.height) {
|
||||
if (styleContext != parentContext &&
|
||||
@ -2004,15 +2004,15 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
#if defined(DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
// for visual debug
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLCharDebug(aBuilder, aForFrame, mRect));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLCharDebug>(aBuilder, aForFrame, mRect));
|
||||
#endif
|
||||
}
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLCharForeground(aBuilder, aForFrame, this,
|
||||
aIndex,
|
||||
aSelectedRect &&
|
||||
!aSelectedRect->IsEmpty()));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLCharForeground>(aBuilder, aForFrame, this,
|
||||
aIndex,
|
||||
aSelectedRect &&
|
||||
!aSelectedRect->IsEmpty()));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -625,7 +625,7 @@ nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayMathMLError(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayMathMLError>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -318,8 +318,8 @@ nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder,
|
||||
nscoord w = aMetrics.rightBearing - aMetrics.leftBearing;
|
||||
nscoord h = aMetrics.ascent + aMetrics.descent;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLBoundingMetrics(aBuilder, aFrame, nsRect(x,y,w,h)));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLBoundingMetrics>(aBuilder, aFrame, nsRect(x,y,w,h)));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -370,8 +370,8 @@ nsMathMLFrame::DisplayBar(nsDisplayListBuilder* aBuilder,
|
||||
if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty())
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLBar(aBuilder, aFrame, aRect, aIndex));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLBar>(aBuilder, aFrame, aRect, aIndex));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -873,6 +873,6 @@ nsMathMLmencloseFrame::DisplayNotation(nsDisplayListBuilder* aBuilder,
|
||||
aThickness <= 0)
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayNotation(aBuilder, aFrame, aRect, aThickness, aType));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayNotation>(aBuilder, aFrame, aRect, aThickness, aType));
|
||||
}
|
||||
|
@ -656,7 +656,7 @@ nsMathMLmfracFrame::DisplaySlash(nsDisplayListBuilder* aBuilder,
|
||||
if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty())
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLSlash(aBuilder, aFrame, aRect, aThickness,
|
||||
StyleVisibility()->mDirection));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLSlash>(aBuilder, aFrame, aRect, aThickness,
|
||||
StyleVisibility()->mDirection));
|
||||
}
|
||||
|
@ -1232,8 +1232,7 @@ nsMathMLmtdFrame::ProcessBorders(nsTableFrame* aFrame,
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplaymtdBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(MakeDisplayItem<nsDisplaymtdBorder>(aBuilder, this));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2257,7 +2257,7 @@ nsDisplayListBuilder::BuildCompositorHitTestInfoIfNeeded(nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
nsDisplayCompositorHitTestInfo* item =
|
||||
new (this) nsDisplayCompositorHitTestInfo(this, aFrame, info);
|
||||
MakeDisplayItem<nsDisplayCompositorHitTestInfo>(this, aFrame, info);
|
||||
|
||||
SetCompositorHitTestInfo(item);
|
||||
aList->AppendToTop(item);
|
||||
@ -3531,9 +3531,10 @@ nsDisplayBackgroundImage::GetInitData(nsDisplayListBuilder* aBuilder,
|
||||
};
|
||||
}
|
||||
|
||||
nsDisplayBackgroundImage::nsDisplayBackgroundImage(const InitData& aInitData,
|
||||
nsDisplayBackgroundImage::nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder,
|
||||
const InitData& aInitData,
|
||||
nsIFrame* aFrameForBounds)
|
||||
: nsDisplayImageContainer(aInitData.builder, aInitData.frame)
|
||||
: nsDisplayImageContainer(aBuilder, aInitData.frame)
|
||||
, mBackgroundStyle(aInitData.backgroundStyle)
|
||||
, mImage(aInitData.image)
|
||||
, mDependentFrame(nullptr)
|
||||
@ -3643,7 +3644,7 @@ SpecialCutoutRegionCase(nsDisplayListBuilder* aBuilder,
|
||||
region.Sub(aBackgroundRect, *static_cast<nsRegion*>(cutoutRegion));
|
||||
region.MoveBy(aBuilder->ToReferenceFrame(aFrame));
|
||||
aList->AppendToTop(
|
||||
new (aBuilder) nsDisplaySolidColorRegion(aBuilder, aFrame, region, aColor));
|
||||
MakeDisplayItem<nsDisplaySolidColorRegion>(aBuilder, aFrame, region, aColor));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -3748,12 +3749,12 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
nsDisplayBackgroundColor *bgItem;
|
||||
if (aSecondaryReferenceFrame) {
|
||||
bgItem =
|
||||
new (aBuilder) nsDisplayTableBackgroundColor(aBuilder, aSecondaryReferenceFrame, bgColorRect, bg,
|
||||
MakeDisplayItem<nsDisplayTableBackgroundColor>(aBuilder, aSecondaryReferenceFrame, bgColorRect, bg,
|
||||
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0),
|
||||
aFrame);
|
||||
} else {
|
||||
bgItem =
|
||||
new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bgColorRect, bg,
|
||||
MakeDisplayItem<nsDisplayBackgroundColor>(aBuilder, aFrame, bgColorRect, bg,
|
||||
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0));
|
||||
}
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
@ -3765,11 +3766,11 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
if (theme->NeedToClearBackgroundBehindWidget(aFrame, aFrame->StyleDisplay()->mAppearance) &&
|
||||
aBuilder->IsInChromeDocumentOrPopup() && !aBuilder->IsInTransform()) {
|
||||
bgItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayClearBackground(aBuilder, aFrame));
|
||||
MakeDisplayItem<nsDisplayClearBackground>(aBuilder, aFrame));
|
||||
}
|
||||
if (aSecondaryReferenceFrame) {
|
||||
nsDisplayTableThemedBackground* bgItem =
|
||||
new (aBuilder) nsDisplayTableThemedBackground(aBuilder,
|
||||
MakeDisplayItem<nsDisplayTableThemedBackground>(aBuilder,
|
||||
aSecondaryReferenceFrame,
|
||||
bgRect,
|
||||
aFrame);
|
||||
@ -3777,7 +3778,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
bgItemList.AppendToTop(bgItem);
|
||||
} else {
|
||||
nsDisplayThemedBackground* bgItem =
|
||||
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame, bgRect);
|
||||
MakeDisplayItem<nsDisplayThemedBackground>(aBuilder, aFrame, bgRect);
|
||||
bgItem->Init(aBuilder);
|
||||
bgItemList.AppendToTop(bgItem);
|
||||
}
|
||||
@ -3851,9 +3852,9 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
nsDisplayBackgroundImage::InitData tableData = bgData;
|
||||
nsIFrame* styleFrame = tableData.frame;
|
||||
tableData.frame = aSecondaryReferenceFrame;
|
||||
bgItem = new (aBuilder) nsDisplayTableBackgroundImage(tableData, styleFrame);
|
||||
bgItem = MakeDisplayItem<nsDisplayTableBackgroundImage>(aBuilder, tableData, styleFrame);
|
||||
} else {
|
||||
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
|
||||
bgItem = MakeDisplayItem<nsDisplayBackgroundImage>(aBuilder, bgData);
|
||||
}
|
||||
}
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
@ -3876,9 +3877,9 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
nsIFrame* styleFrame = tableData.frame;
|
||||
tableData.frame = aSecondaryReferenceFrame;
|
||||
|
||||
bgItem = new (aBuilder) nsDisplayTableBackgroundImage(tableData, styleFrame);
|
||||
bgItem = MakeDisplayItem<nsDisplayTableBackgroundImage>(aBuilder, tableData, styleFrame);
|
||||
} else {
|
||||
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
|
||||
bgItem = MakeDisplayItem<nsDisplayBackgroundImage>(aBuilder, bgData);
|
||||
}
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
thisItemList.AppendToTop(bgItem);
|
||||
@ -3891,12 +3892,12 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
||||
// item with respect to asr.
|
||||
if (aSecondaryReferenceFrame) {
|
||||
thisItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayTableBlendMode(aBuilder, aSecondaryReferenceFrame, &thisItemList,
|
||||
MakeDisplayItem<nsDisplayTableBlendMode>(aBuilder, aSecondaryReferenceFrame, &thisItemList,
|
||||
bg->mImage.mLayers[i].mBlendMode,
|
||||
asr, i + 1, aFrame));
|
||||
} else {
|
||||
thisItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayBlendMode(aBuilder, aFrame, &thisItemList,
|
||||
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, aFrame, &thisItemList,
|
||||
bg->mImage.mLayers[i].mBlendMode,
|
||||
asr, i + 1));
|
||||
}
|
||||
@ -4399,9 +4400,10 @@ nsDisplayBackgroundImage::GetBoundsInternal(nsDisplayListBuilder* aBuilder,
|
||||
aBuilder->GetBackgroundPaintFlags());
|
||||
}
|
||||
|
||||
nsDisplayTableBackgroundImage::nsDisplayTableBackgroundImage(const InitData& aData,
|
||||
nsDisplayTableBackgroundImage::nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder,
|
||||
const InitData& aData,
|
||||
nsIFrame* aCellFrame)
|
||||
: nsDisplayBackgroundImage(aData, aCellFrame)
|
||||
: nsDisplayBackgroundImage(aBuilder, aData, aCellFrame)
|
||||
, mStyleFrame(aCellFrame)
|
||||
, mTableType(GetTableTypeFromFrame(mStyleFrame))
|
||||
{
|
||||
@ -6268,7 +6270,7 @@ nsDisplayWrapList::MergeDisplayListFromItem(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
// Create a new nsDisplayWrapList using a copy-constructor. This is done
|
||||
// to preserve the information about bounds.
|
||||
nsDisplayWrapList* wrapper = new (aBuilder) nsDisplayWrapList(aBuilder, *wrappedItem);
|
||||
nsDisplayWrapList* wrapper = MakeDisplayItem<nsDisplayWrapList>(aBuilder, *wrappedItem);
|
||||
|
||||
// Set the display list pointer of the new wrapper item to the display list
|
||||
// of the wrapped item.
|
||||
@ -6920,7 +6922,7 @@ nsDisplayBlendContainer::CreateForMixBlendMode(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame, nsDisplayList* aList,
|
||||
const ActiveScrolledRoot* aActiveScrolledRoot)
|
||||
{
|
||||
return new (aBuilder) nsDisplayBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, false);
|
||||
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, false);
|
||||
}
|
||||
|
||||
/* static */ nsDisplayBlendContainer*
|
||||
@ -6928,7 +6930,7 @@ nsDisplayBlendContainer::CreateForBackgroundBlendMode(nsDisplayListBuilder* aBui
|
||||
nsIFrame* aFrame, nsDisplayList* aList,
|
||||
const ActiveScrolledRoot* aActiveScrolledRoot)
|
||||
{
|
||||
return new (aBuilder) nsDisplayBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, true);
|
||||
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, true);
|
||||
}
|
||||
|
||||
nsDisplayBlendContainer::nsDisplayBlendContainer(nsDisplayListBuilder* aBuilder,
|
||||
@ -6995,7 +6997,7 @@ nsDisplayTableBlendContainer::CreateForBackgroundBlendMode(nsDisplayListBuilder*
|
||||
const ActiveScrolledRoot* aActiveScrolledRoot,
|
||||
nsIFrame* aAncestorFrame)
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, true, aAncestorFrame);
|
||||
return MakeDisplayItem<nsDisplayTableBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, true, aAncestorFrame);
|
||||
}
|
||||
|
||||
nsDisplayOwnLayer::nsDisplayOwnLayer(nsDisplayListBuilder* aBuilder,
|
||||
@ -7374,7 +7376,7 @@ nsDisplayFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayList temp;
|
||||
temp.AppendToTop(aImage);
|
||||
|
||||
return new (aBuilder) nsDisplayFixedPosition(aBuilder, aFrame, &temp, aIndex + 1);
|
||||
return MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, aFrame, &temp, aIndex + 1);
|
||||
}
|
||||
|
||||
|
||||
@ -7487,7 +7489,7 @@ nsDisplayTableFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBui
|
||||
nsDisplayList temp;
|
||||
temp.AppendToTop(aImage);
|
||||
|
||||
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
|
||||
return MakeDisplayItem<nsDisplayTableFixedPosition>(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
|
||||
}
|
||||
|
||||
nsDisplayStickyPosition::nsDisplayStickyPosition(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -130,10 +130,14 @@ typedef mozilla::EnumSet<mozilla::gfx::CompositionOp> BlendModeSet;
|
||||
#define NS_DISPLAY_DECL_NAME(n, e) \
|
||||
virtual const char* Name() const override { return n; } \
|
||||
virtual DisplayItemType GetType() const override { return DisplayItemType::e; } \
|
||||
private: \
|
||||
void* operator new(size_t aSize, \
|
||||
nsDisplayListBuilder* aBuilder) { \
|
||||
return aBuilder->Allocate(aSize, DisplayItemType::e); \
|
||||
}
|
||||
} \
|
||||
template<typename T, typename... Args> \
|
||||
friend T* ::MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs); \
|
||||
public:
|
||||
|
||||
|
||||
/**
|
||||
@ -2025,6 +2029,13 @@ protected:
|
||||
|
||||
class nsDisplayWrapList;
|
||||
|
||||
template<typename T, typename... Args>
|
||||
MOZ_ALWAYS_INLINE T*
|
||||
MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs)
|
||||
{
|
||||
return new (aBuilder) T(aBuilder, mozilla::Forward<Args>(aArgs)...);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the unit of rendering and event testing. Each instance of this
|
||||
* class represents an entity that can be drawn on the screen, e.g., a
|
||||
@ -3386,10 +3397,6 @@ public:
|
||||
}
|
||||
virtual const char* Name() const override { return mName; }
|
||||
virtual DisplayItemType GetType() const override { return mType; }
|
||||
void* operator new(size_t aSize,
|
||||
nsDisplayListBuilder* aBuilder) {
|
||||
return aBuilder->Allocate(aSize, DisplayItemType::TYPE_GENERIC);
|
||||
}
|
||||
|
||||
// This override is needed because GetType() for nsDisplayGeneric subclasses
|
||||
// does not match TYPE_GENERIC that was used to allocate the object.
|
||||
@ -3400,6 +3407,13 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void* operator new(size_t aSize,
|
||||
nsDisplayListBuilder* aBuilder) {
|
||||
return aBuilder->Allocate(aSize, DisplayItemType::TYPE_GENERIC);
|
||||
}
|
||||
template<typename T, typename... Args>
|
||||
friend T* MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs);
|
||||
|
||||
PaintCallback mPaint;
|
||||
OldPaintCallback mOldPaint; // XXX: should be removed eventually
|
||||
const char* mName;
|
||||
@ -3453,7 +3467,7 @@ protected:
|
||||
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
aLists.Outlines()->AppendToTop( \
|
||||
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name)); \
|
||||
MakeDisplayItem<nsDisplayReflowCount>(aBuilder, this, _name)); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
@ -3462,7 +3476,7 @@ protected:
|
||||
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
aLists.Outlines()->AppendToTop( \
|
||||
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name, _color)); \
|
||||
MakeDisplayItem<nsDisplayReflowCount>(aBuilder, this, _name, _color)); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
@ -3834,7 +3848,8 @@ public:
|
||||
const nsRect& aBackgroundRect,
|
||||
const nsStyleBackground* aBackgroundStyle);
|
||||
|
||||
explicit nsDisplayBackgroundImage(const InitData& aInitData,
|
||||
explicit nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder,
|
||||
const InitData& aInitData,
|
||||
nsIFrame* aFrameForBounds = nullptr);
|
||||
virtual ~nsDisplayBackgroundImage();
|
||||
|
||||
@ -4028,7 +4043,7 @@ TableType GetTableTypeFromFrame(nsIFrame* aFrame);
|
||||
*/
|
||||
class nsDisplayTableBackgroundImage : public nsDisplayBackgroundImage {
|
||||
public:
|
||||
nsDisplayTableBackgroundImage(const InitData& aInitData, nsIFrame* aCellFrame);
|
||||
nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder, const InitData& aInitData, nsIFrame* aCellFrame);
|
||||
|
||||
virtual uint32_t GetPerFrameKey() const override {
|
||||
return (mLayer << (TYPE_BITS + static_cast<uint8_t>(TableTypeBits::COUNT))) |
|
||||
@ -5104,7 +5119,7 @@ public:
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayOpacity);
|
||||
return new (aBuilder) nsDisplayOpacity(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayOpacity>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
@ -5184,7 +5199,7 @@ public:
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayBlendMode);
|
||||
return new (aBuilder) nsDisplayBlendMode(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayBlendMode>(aBuilder, *this);
|
||||
}
|
||||
|
||||
nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
@ -5248,7 +5263,7 @@ public:
|
||||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableBlendMode(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayTableBlendMode>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
|
||||
@ -5285,7 +5300,7 @@ public:
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayBlendContainer);
|
||||
return new (aBuilder) nsDisplayBlendContainer(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
@ -5344,7 +5359,7 @@ public:
|
||||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableBlendContainer(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayTableBlendContainer>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
|
||||
@ -5582,7 +5597,7 @@ public:
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayStickyPosition);
|
||||
return new (aBuilder) nsDisplayStickyPosition(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayStickyPosition>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
@ -5636,7 +5651,7 @@ public:
|
||||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayFixedPosition(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
@ -5694,7 +5709,7 @@ public:
|
||||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayTableFixedPosition>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
|
||||
@ -5899,7 +5914,7 @@ public:
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayMask);
|
||||
return new (aBuilder) nsDisplayMask(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayMask>(aBuilder, *this);
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("Mask", TYPE_MASK)
|
||||
@ -5988,7 +6003,7 @@ public:
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayFilter);
|
||||
return new (aBuilder) nsDisplayFilter(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayFilter>(aBuilder, *this);
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("Filter", TYPE_FILTER)
|
||||
|
@ -260,7 +260,7 @@ SVGGeometryFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
DisplayOutline(aBuilder, aLists);
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplaySVGGeometry(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplaySVGGeometry>(aBuilder, this));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -3204,7 +3204,7 @@ SVGTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
DisplayOutline(aBuilder, aLists);
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplaySVGText(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplaySVGText>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -786,10 +786,10 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayListSet set(&newList, &newList, &newList,
|
||||
&newList, &newList, &newList);
|
||||
BuildDisplayListForNonBlockChildren(aBuilder, set);
|
||||
aLists.Content()->AppendToTop(new (aBuilder) nsDisplaySVGWrapper(aBuilder, this, &newList));
|
||||
aLists.Content()->AppendToTop(MakeDisplayItem<nsDisplaySVGWrapper>(aBuilder, this, &newList));
|
||||
} else if (IsVisibleForPainting(aBuilder) || !aBuilder->IsForPainting()) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayOuterSVG(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayOuterSVG>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -391,8 +391,7 @@ nsTableCellFrame::ProcessBorders(nsTableFrame* aFrame,
|
||||
|
||||
if (!GetContentEmpty() ||
|
||||
StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(MakeDisplayItem<nsDisplayBorder>(aBuilder, this));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -496,7 +495,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
bool hasBoxShadow = !!StyleEffects()->mBoxShadow;
|
||||
if (hasBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
// display background if we need to.
|
||||
@ -512,7 +511,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// display inset box-shadows if we need to.
|
||||
if (hasBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, this));
|
||||
}
|
||||
|
||||
// display borders if we need to
|
||||
@ -520,8 +519,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
// and display the selection border if we need to
|
||||
if (IsSelected()) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayTableCellSelection(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayTableCellSelection>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1533,7 +1533,7 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
|
||||
// Paint the outset box-shadows for the table frames
|
||||
if (aFrame->StyleEffects()->mBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, aFrame));
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, aFrame));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1601,7 +1601,7 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
|
||||
// Paint the inset box-shadows for the table frames
|
||||
if (aFrame->StyleEffects()->mBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, aFrame));
|
||||
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, aFrame));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1616,13 +1616,13 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
|
||||
if (table->IsBorderCollapse()) {
|
||||
if (table->HasBCBorders()) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table));
|
||||
MakeDisplayItem<nsDisplayTableBorderCollapse>(aBuilder, table));
|
||||
}
|
||||
} else {
|
||||
const nsStyleBorder* borderStyle = aFrame->StyleBorder();
|
||||
if (borderStyle->HasBorder()) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBorder(aBuilder, table));
|
||||
MakeDisplayItem<nsDisplayBorder>(aBuilder, table));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1348,11 +1348,11 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
if (mState & NS_STATE_CURRENTLY_IN_DEBUG) {
|
||||
destination.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, this, PaintXULDebugBackground,
|
||||
destination.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintXULDebugBackground,
|
||||
"XULDebugBackground"));
|
||||
destination.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULDebug(aBuilder, this));
|
||||
destination.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULDebug>(aBuilder, this));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1384,11 +1384,11 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
DisplayListClipState::AutoSaveRestore ownLayerClipState(aBuilder);
|
||||
|
||||
// Wrap the list to make it its own layer
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayOwnLayer(aBuilder, this, &masterList, ownLayerASR,
|
||||
nsDisplayOwnLayerFlags::eNone,
|
||||
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
|
||||
mozilla::layers::ScrollThumbData{}, true, true));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &masterList, ownLayerASR,
|
||||
nsDisplayOwnLayerFlags::eNone,
|
||||
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
|
||||
mozilla::layers::ScrollThumbData{}, true, true));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2086,14 +2086,13 @@ public:
|
||||
virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame,
|
||||
nsDisplayList* aList) override {
|
||||
return new (aBuilder)
|
||||
nsDisplayXULEventRedirector(aBuilder, aFrame, aList, mTargetFrame);
|
||||
return MakeDisplayItem<nsDisplayXULEventRedirector>(aBuilder, aFrame, aList,
|
||||
mTargetFrame);
|
||||
}
|
||||
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayItem* aItem) override {
|
||||
return new (aBuilder)
|
||||
nsDisplayXULEventRedirector(aBuilder, aItem->Frame(), aItem,
|
||||
mTargetFrame);
|
||||
return MakeDisplayItem<nsDisplayXULEventRedirector>(aBuilder, aItem->Frame(), aItem,
|
||||
mTargetFrame);
|
||||
}
|
||||
private:
|
||||
nsIFrame* mTargetFrame;
|
||||
|
@ -153,8 +153,8 @@ nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, this, GetBackgroundRectRelativeToSelf(),
|
||||
aLists.BorderBackground());
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULGroupBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULGroupBorder>(aBuilder, this));
|
||||
|
||||
DisplayOutline(aBuilder, aLists);
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsDisplayList list;
|
||||
list.AppendToTop(
|
||||
new (aBuilder) nsDisplayXULImage(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayXULImage>(aBuilder, this));
|
||||
|
||||
CreateOwnLayerIfNeeded(aBuilder, &list);
|
||||
|
||||
|
@ -112,8 +112,8 @@ nsLeafBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (!aBuilder->IsForEventDelivery() || !IsVisibleForPainting(aBuilder))
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayEventReceiver(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
|
@ -326,8 +326,8 @@ nsSliderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (aBuilder->IsForEventDelivery() && isDraggingThumb()) {
|
||||
// This is EVIL, we shouldn't be messing with event delivery just to get
|
||||
// thumb mouse drag events to arrive at the slider!
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayEventReceiver(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -458,16 +458,16 @@ nsSliderFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
// Wrap the list to make it its own layer.
|
||||
const ActiveScrolledRoot* ownLayerASR = contASRTracker.GetContainerASR();
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayOwnLayer(aBuilder, this, &masterList, ownLayerASR,
|
||||
flags, scrollTargetId,
|
||||
ScrollThumbData{scrollDirection,
|
||||
GetThumbRatio(),
|
||||
thumbStart,
|
||||
thumbLength,
|
||||
isAsyncDraggable,
|
||||
sliderTrackStart,
|
||||
sliderTrackLength}));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &masterList, ownLayerASR,
|
||||
flags, scrollTargetId,
|
||||
ScrollThumbData{scrollDirection,
|
||||
GetThumbRatio(),
|
||||
thumbStart,
|
||||
thumbLength,
|
||||
isAsyncDraggable,
|
||||
sliderTrackStart,
|
||||
sliderTrackLength}));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -384,8 +384,8 @@ nsSplitterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (mInner->mDragging && aBuilder->IsForEventDelivery())
|
||||
{
|
||||
// XXX It's probably better not to check visibility here, right?
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayEventReceiver(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -373,8 +373,8 @@ nsTextBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsLeafBoxFrame::BuildDisplayList(aBuilder, aLists);
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULTextBox(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULTextBox>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2845,7 +2845,7 @@ nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
if (!mView || !GetContent ()->GetComposedDoc()->GetWindow())
|
||||
return;
|
||||
|
||||
nsDisplayItem* item = new (aBuilder) nsDisplayTreeBody(aBuilder, this);
|
||||
nsDisplayItem* item = MakeDisplayItem<nsDisplayTreeBody>(aBuilder, this);
|
||||
aLists.Content()->AppendToTop(item);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
|
@ -126,8 +126,8 @@ nsTreeColFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
WrapListsInRedirector(aBuilder, set, aLists);
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULTreeColSplitterTarget(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULTreeColSplitterTarget>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
Loading…
Reference in New Issue
Block a user