Backed out 3 changesets (bug 1436904) for many crashes see bugs: 1440281, 1440302, 1440303, 1440313. a=backout

Backed out changeset 27f0762d4472 (bug 1436904)
Backed out changeset 27640f52e188 (bug 1436904)
Backed out changeset 2b4d117c27dc (bug 1436904)
This commit is contained in:
Dorel Luca 2018-02-22 17:28:59 +02:00
Родитель 6ad641c5c4
Коммит bd05e3853c
51 изменённых файлов: 247 добавлений и 326 удалений

Просмотреть файл

@ -5217,8 +5217,8 @@ PresShell::AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
nsIFrame* aFrame,
const nsRect& aBounds)
{
aList.AppendToBottom(
MakeDisplayItem<nsDisplaySolidColor>(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
aList.AppendToBottom(new (&aBuilder)
nsDisplaySolidColor(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
}
static bool
@ -5308,7 +5308,7 @@ PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
if (!addedScrollingBackgroundColor || forceUnscrolledItem) {
aList.AppendToBottom(
MakeDisplayItem<nsDisplaySolidColor>(&aBuilder, aFrame, aBounds, bgcolor));
new (&aBuilder) nsDisplaySolidColor(&aBuilder, aFrame, aBounds, bgcolor));
}
}

Просмотреть файл

@ -3021,7 +3021,7 @@ nsLayoutUtils::GetLayerTransformForFrame(nsIFrame* aFrame,
builder.BeginFrame();
nsDisplayList list;
nsDisplayTransform* item =
MakeDisplayItem<nsDisplayTransform>(&builder, aFrame, &list, nsRect());
new (&builder) 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(
MakeDisplayItem<nsDisplayButtonBoxShadowOuter>(aBuilder, this));
aBackground->AppendToTop(new (aBuilder)
nsDisplayButtonBoxShadowOuter(aBuilder, this));
}
nsRect buttonRect = mFrame->GetRectRelativeToSelf();
@ -486,14 +486,14 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, mFrame, buttonRect, aBackground);
aBackground->AppendToTop(
MakeDisplayItem<nsDisplayButtonBorder>(aBuilder, this));
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->AppendToTop(
MakeDisplayItem<nsDisplayButtonForeground>(aBuilder, this));
aForeground->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayComboboxFocus>(aBuilder, this));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayBoxShadowOuter(aBuilder, this));
}
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
@ -205,8 +205,8 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aLists.BorderBackground(),
/* aAllowWillPaintBorderOptimization = */ false);
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayFieldSetBorder>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplaySolidColor>(aBuilder,
new (aBuilder) nsDisplaySolidColor(aBuilder,
this, nsRect(aBuilder->ToReferenceFrame(this), GetSize()),
mLastDropdownBackstopColor));
}

Просмотреть файл

@ -305,7 +305,7 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayRangeFocusRing>(aBuilder, this));
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
}
void

Просмотреть файл

@ -75,11 +75,11 @@ public:
nsOptionEventGrabberWrapper() {}
virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList) override {
return MakeDisplayItem<nsDisplayOptionEventGrabber>(aBuilder, aFrame, aList);
return new (aBuilder) nsDisplayOptionEventGrabber(aBuilder, aFrame, aList);
}
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) override {
return MakeDisplayItem<nsDisplayOptionEventGrabber>(aBuilder, aItem->Frame(), aItem);
return new (aBuilder) 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(
MakeDisplayItem<nsDisplayListFocus>(aBuilder, this));
aLists.Outlines()->AppendToTop(new (aBuilder)
nsDisplayListFocus(aBuilder, this));
}
}

Просмотреть файл

@ -861,10 +861,9 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
ClipMarker(aContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
markerRect, clipState);
nsDisplayItem* marker =
MakeDisplayItem<nsDisplayTextOverflowMarker>(mBuilder, mBlock, markerRect,
aLine->GetLogicalAscent(), mIStart.mStyle,
aLineNumber, 0);
nsDisplayItem* marker = new (mBuilder)
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
aLine->GetLogicalAscent(), mIStart.mStyle, aLineNumber, 0);
mMarkerList.AppendToTop(marker);
}
@ -879,10 +878,9 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
ClipMarker(aContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
markerRect, clipState);
nsDisplayItem* marker =
MakeDisplayItem<nsDisplayTextOverflowMarker>(mBuilder, mBlock, markerRect,
aLine->GetLogicalAscent(), mIEnd.mStyle,
aLineNumber, 1);
nsDisplayItem* marker = new (mBuilder)
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 =
MakeDisplayItem<nsDisplayWrapList>(aBuilder, this, &topLayerList);
new (aBuilder) 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(
MakeDisplayItem<nsDisplayBullet>(aBuilder, this));
new (aBuilder) nsDisplayBullet(aBuilder, this));
}
Maybe<BulletRenderer>

Просмотреть файл

@ -470,11 +470,11 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayCanvasBackgroundColor>(aBuilder, this));
new (aBuilder) nsDisplayCanvasBackgroundColor(aBuilder, this));
if (isThemed) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayCanvasThemedBackground>(aBuilder, this));
new (aBuilder) nsDisplayCanvasThemedBackground(aBuilder, this));
return;
}
@ -528,14 +528,14 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
{
DisplayListClipState::AutoSaveRestore bgImageClip(aBuilder);
bgImageClip.Clear();
bgItem = MakeDisplayItem<nsDisplayCanvasBackgroundImage>(aBuilder, bgData);
bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(bgData);
bgItem->SetDependentFrame(aBuilder, dependentFrame);
}
thisItemList.AppendToTop(
nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, this, bgItem, i));
} else {
nsDisplayCanvasBackgroundImage* bgItem = MakeDisplayItem<nsDisplayCanvasBackgroundImage>(aBuilder, bgData);
nsDisplayCanvasBackgroundImage* bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(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(
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, this, &thisItemList,
layers.mLayers[i].mBlendMode,
thisItemASR, i + 1));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayCanvasFocus>(aBuilder, this));
aLists.Outlines()->AppendToTop(new (aBuilder)
nsDisplayCanvasFocus(aBuilder, this));
}
void

Просмотреть файл

@ -190,8 +190,8 @@ public:
class nsDisplayCanvasBackgroundImage : public nsDisplayBackgroundImage {
public:
explicit nsDisplayCanvasBackgroundImage(nsDisplayListBuilder* aBuilder, const InitData& aInitData)
: nsDisplayBackgroundImage(aBuilder, aInitData)
explicit nsDisplayCanvasBackgroundImage(const InitData& aInitData)
: nsDisplayBackgroundImage(aInitData)
{
}

Просмотреть файл

@ -1280,7 +1280,7 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (IsVisibleForPainting(aBuilder)) {
aLists.BorderBackground()->
AppendToTop(MakeDisplayItem<nsDisplayColumnRule>(aBuilder, this));
AppendToTop(new (aBuilder) 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(
MakeDisplayItem<nsDisplaySelectionOverlay>(aBuilder, this, selectionValue));
aList->AppendToTop(new (aBuilder)
nsDisplaySelectionOverlay(aBuilder, this, selectionValue));
}
void
@ -2331,7 +2331,7 @@ nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
}
aLists.Outlines()->AppendToTop(
MakeDisplayItem<nsDisplayOutline>(aBuilder, this));
new (aBuilder) nsDisplayOutline(aBuilder, this));
}
void
@ -2351,7 +2351,7 @@ nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder,
if (!IsVisibleForPainting(aBuilder))
return;
aList->AppendToTop(MakeDisplayItem<nsDisplayCaret>(aBuilder, this));
aList->AppendToTop(new (aBuilder) nsDisplayCaret(aBuilder, this));
}
nscolor
@ -2390,23 +2390,23 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
nsCSSShadowArray* shadows = StyleEffects()->mBoxShadow;
if (shadows && shadows->HasShadowWithInset(false)) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayBoxShadowOuter(aBuilder, this));
}
bool bgIsThemed = DisplayBackgroundUnconditional(aBuilder, aLists,
aForceBackground);
if (shadows && shadows->HasShadowWithInset(true)) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayBorder>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayGeneric>(aBuilder, aFrame, PaintDebugBorder, "DebugBorder",
DisplayItemType::TYPE_DEBUG_BORDER));
aLists.Outlines()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayGeneric>(aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
DisplayItemType::TYPE_EVENT_TARGET_BORDER));
aLists.Outlines()->AppendToTop(new (aBuilder)
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 =
MakeDisplayItem<nsDisplayTransform>(aBuilder, aFrame, aSource,
new (aBuilder) 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 = MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, this);
eventRegions = new (aBuilder) nsDisplayLayerEventRegions(aBuilder, this);
eventRegions->AddFrame(aBuilder, this);
aBuilder->SetLayerEventRegions(eventRegions);
}
@ -3072,7 +3072,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
if (eventRegions) {
eventRegions->Destroy(aBuilder);
eventRegions = MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, this);
eventRegions = new (aBuilder) nsDisplayLayerEventRegions(aBuilder, this);
eventRegions->AddFrame(aBuilder, this);
aBuilder->SetLayerEventRegions(eventRegions);
}
@ -3116,7 +3116,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
if (hasOverrideDirtyRect && gfxPrefs::LayoutDisplayListShowArea()) {
nsDisplaySolidColor* color =
MakeDisplayItem<nsDisplaySolidColor>(aBuilder, this,
new (aBuilder) 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(
MakeDisplayItem<nsDisplayFilter>(aBuilder, this, &resultList,
new (aBuilder) 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(
MakeDisplayItem<nsDisplayMask>(aBuilder, this, &resultList, !useOpacity,
new (aBuilder) 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(
MakeDisplayItem<nsDisplayOpacity>(aBuilder, this, &resultList,
new (aBuilder) nsDisplayOpacity(aBuilder, this, &resultList,
containerItemASR,
opacityItemForEventsAndPluginsOnly));
if (aCreatedContainerItem) {
@ -3327,7 +3327,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
GetOffsetToCrossDoc(outerReferenceFrame));
nsDisplayTransform *transformItem =
MakeDisplayItem<nsDisplayTransform>(aBuilder, this,
new (aBuilder) nsDisplayTransform(aBuilder, this,
&resultList, visibleRect, 0,
allowAsyncAnimation);
resultList.AppendToTop(transformItem);
@ -3337,7 +3337,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
clipState.Restore();
}
resultList.AppendToTop(
MakeDisplayItem<nsDisplayPerspective>(
new (aBuilder) 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(
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &resultList,
new (aBuilder) 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(
MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, this, &resultList, fixedASR));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayStickyPosition>(aBuilder, this, &resultList, stickyASR));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, this, &resultList,
new (aBuilder) 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 MakeDisplayItem<nsDisplayWrapList>(aBuilder, aFrame, aList, aContainerASR, true);
return new (aBuilder) 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 =
MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, child);
new (aBuilder) 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(
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, aList, aBuilder->CurrentActiveScrolledRoot()));
aList->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
}
}
@ -1425,7 +1425,7 @@ nsHTMLFramesetBorderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayFramesetBorder>(aBuilder, this));
new (aBuilder) nsDisplayFramesetBorder(aBuilder, this));
}
void nsHTMLFramesetBorderFrame::PaintBorder(DrawTarget* aDrawTarget,
@ -1636,5 +1636,5 @@ nsHTMLFramesetBlankFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayFramesetBlank>(aBuilder, this));
new (aBuilder) nsDisplayFramesetBlank(aBuilder, this));
}

Просмотреть файл

@ -3072,9 +3072,9 @@ AppendToTop(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists,
flags |= nsDisplayOwnLayerFlags::eScrollbarContainer;
}
newItem = MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, aSourceFrame, aSource, asr, flags, scrollTarget);
newItem = new (aBuilder) nsDisplayOwnLayer(aBuilder, aSourceFrame, aSource, asr, flags, scrollTarget);
} else {
newItem = MakeDisplayItem<nsDisplayWrapList>(aBuilder, aSourceFrame, aSource, asr);
newItem = new (aBuilder) nsDisplayWrapList(aBuilder, aSourceFrame, aSource, asr);
}
if (aFlags & APPEND_POSITIONED) {
@ -3618,9 +3618,9 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (dirtyRectHasBeenOverriden && gfxPrefs::LayoutDisplayListShowArea()) {
nsDisplaySolidColor* color =
MakeDisplayItem<nsDisplaySolidColor>(aBuilder, mOuter,
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
NS_RGBA(0, 0, 255, 64), false);
new (aBuilder) nsDisplaySolidColor(aBuilder, mOuter,
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
NS_RGBA(0, 0, 255, 64), false);
color->SetOverrideZIndex(INT32_MAX);
scrolledContent.PositionedDescendants()->AppendToTop(color);
}
@ -3695,13 +3695,13 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
info |= CompositorHitTestInfo::eRequiresTargetConfirmation;
}
nsDisplayCompositorHitTestInfo* hitInfo =
MakeDisplayItem<nsDisplayCompositorHitTestInfo>(aBuilder, mScrolledFrame, info, 1,
new (aBuilder) nsDisplayCompositorHitTestInfo(aBuilder, mScrolledFrame, info, 1,
Some(mScrollPort + aBuilder->ToReferenceFrame(mOuter)));
AppendInternalItemToTop(scrolledContent, hitInfo, zIndex);
}
if (aBuilder->IsBuildingLayerEventRegions()) {
nsDisplayLayerEventRegions* inactiveRegionItem =
MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, mScrolledFrame, 1);
new (aBuilder) nsDisplayLayerEventRegions(aBuilder, mScrolledFrame, 1);
inactiveRegionItem->AddInactiveScrollPort(mScrolledFrame, mScrollPort + aBuilder->ToReferenceFrame(mOuter));
AppendInternalItemToTop(scrolledContent, inactiveRegionItem, zIndex);
}
@ -3709,7 +3709,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (aBuilder->ShouldBuildScrollInfoItemsForHoisting()) {
aBuilder->AppendNewScrollInfoItemForHoisting(
MakeDisplayItem<nsDisplayScrollInfoLayer>(aBuilder, mScrolledFrame,
new (aBuilder) nsDisplayScrollInfoLayer(aBuilder, mScrolledFrame,
mOuter));
}
}

Просмотреть файл

@ -482,7 +482,7 @@ nsHTMLCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
clip(aBuilder, this, clipFlags);
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayCanvas>(aBuilder, this));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayAltFeedback>(aBuilder, this));
aLists.Content()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayImage>(aBuilder, this, mImage, mPrevImage));
aLists.Content()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintDebugImageMap, "DebugImageMap",
DisplayItemType::TYPE_DEBUG_IMAGE_MAP));
aLists.Outlines()->AppendToTop(new (aBuilder)
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(MakeDisplayItem<nsDisplayTransform>(aBuilder, child,
content.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, child,
&content, content.GetVisibleRect(), ::ComputePageTransform));
set.Content()->AppendToTop(&content);
if (PresContext()->IsRootPaginatedDocument()) {
set.Content()->AppendToTop(
MakeDisplayItem<nsDisplayHeaderFooter>(aBuilder, this));
set.Content()->AppendToTop(new (aBuilder)
nsDisplayHeaderFooter(aBuilder, this));
}
set.MoveTo(aLists);

Просмотреть файл

@ -273,9 +273,9 @@ nsPlaceholderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
#ifdef DEBUG
if (GetShowFrameBorders()) {
aLists.Outlines()->AppendToTop(
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintDebugPlaceholder,
"DebugPlaceholder",
DisplayItemType::TYPE_DEBUG_PLACEHOLDER));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintPrintPlugin, "PrintPlugin",
DisplayItemType::TYPE_PRINT_PLUGIN));
aLists.Content()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayPluginReadback>(aBuilder, this));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayPluginReadback(aBuilder, this));
}
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayPlugin>(aBuilder, this));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayPlugin(aBuilder, this));
}
}

Просмотреть файл

@ -747,9 +747,9 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
content.AppendToTop(
MakeDisplayItem<nsDisplayTransform>(aBuilder, this, &content, content.GetVisibleRect(),
::ComputePageSequenceTransform));
content.AppendToTop(new (aBuilder)
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 = MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, aFrame, &tmpList, aBuilder->CurrentActiveScrolledRoot());
item = new (aBuilder) nsDisplayOwnLayer(aBuilder, aFrame, &tmpList, aBuilder->CurrentActiveScrolledRoot());
}
tempItems.AppendToTop(item);
}
@ -558,7 +558,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
zoomFlags |= nsDisplayOwnLayerFlags::eGenerateScrollableLayer;
}
nsDisplayZoom* zoomItem =
MakeDisplayItem<nsDisplayZoom>(aBuilder, subdocRootFrame, &childItems,
new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems,
subdocAPD, parentAPD, zoomFlags);
childItems.AppendToTop(zoomItem);
needsOwnLayer = false;
@ -570,14 +570,14 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
if (constructResolutionItem) {
nsDisplayResolution* resolutionItem =
MakeDisplayItem<nsDisplayResolution>(aBuilder, subdocRootFrame, &childItems,
flags);
new (aBuilder) 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 = MakeDisplayItem<nsDisplaySubDocument>(
nsDisplaySubDocument* layerItem = new (aBuilder) nsDisplaySubDocument(
aBuilder, subdocRootFrame ? subdocRootFrame : this, this,
&childItems, flags);
childItems.AppendToTop(layerItem);

Просмотреть файл

@ -5237,7 +5237,7 @@ nsTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayText>(aBuilder, this, isSelected));
new (aBuilder) nsDisplayText(aBuilder, this, isSelected));
}
static nsIFrame*

Просмотреть файл

@ -570,7 +570,7 @@ nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (HasVideoElement() && !shouldDisplayPoster) {
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayVideo>(aBuilder, this));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayRemote>(aBuilder, aFrame, this));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayMathMLSelectionRect>(aBuilder, aForFrame, *aSelectedRect));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayMathMLCharDebug>(aBuilder, aForFrame, mRect));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayMathMLCharDebug(aBuilder, aForFrame, mRect));
#endif
}
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayMathMLCharForeground>(aBuilder, aForFrame, this,
aIndex,
aSelectedRect &&
!aSelectedRect->IsEmpty()));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayMathMLCharForeground(aBuilder, aForFrame, this,
aIndex,
aSelectedRect &&
!aSelectedRect->IsEmpty()));
}
void

Просмотреть файл

@ -625,7 +625,7 @@ nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return;
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayMathMLError>(aBuilder, this));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayMathMLBoundingMetrics>(aBuilder, aFrame, nsRect(x,y,w,h)));
aLists.Content()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayMathMLBar>(aBuilder, aFrame, aRect, aIndex));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayMathMLBar(aBuilder, aFrame, aRect, aIndex));
}
void

Просмотреть файл

@ -873,6 +873,6 @@ nsMathMLmencloseFrame::DisplayNotation(nsDisplayListBuilder* aBuilder,
aThickness <= 0)
return;
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayNotation>(aBuilder, aFrame, aRect, aThickness, aType));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayNotation(aBuilder, aFrame, aRect, aThickness, aType));
}

Просмотреть файл

@ -656,7 +656,7 @@ nsMathMLmfracFrame::DisplaySlash(nsDisplayListBuilder* aBuilder,
if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty())
return;
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayMathMLSlash>(aBuilder, aFrame, aRect, aThickness,
StyleVisibility()->mDirection));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayMathMLSlash(aBuilder, aFrame, aRect, aThickness,
StyleVisibility()->mDirection));
}

Просмотреть файл

@ -1232,7 +1232,8 @@ nsMathMLmtdFrame::ProcessBorders(nsTableFrame* aFrame,
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
aLists.BorderBackground()->AppendToTop(MakeDisplayItem<nsDisplaymtdBorder>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplaymtdBorder(aBuilder, this));
return NS_OK;
}

Просмотреть файл

@ -145,7 +145,6 @@ DisplayItemData::DisplayItemData(LayerManagerData* aParent, uint32_t aKey,
, mUsed(true)
, mIsInvalid(false)
, mReusedItem(false)
, mDisconnected(false)
{
MOZ_COUNT_CTOR(DisplayItemData);
@ -261,7 +260,15 @@ static const nsIFrame* sDestroyedFrame = nullptr;
DisplayItemData::~DisplayItemData()
{
MOZ_COUNT_DTOR(DisplayItemData);
Disconnect();
MOZ_RELEASE_ASSERT(mLayer);
for (uint32_t i = 0; i < mFrameList.Length(); i++) {
nsIFrame* frame = mFrameList[i];
if (frame == sDestroyedFrame) {
continue;
}
SmallPointerArray<DisplayItemData>& array = frame->DisplayItemData();
array.RemoveElement(this);
}
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas);
nsPtrHashKey<mozilla::DisplayItemData>* entry
@ -276,27 +283,6 @@ DisplayItemData::~DisplayItemData()
}
}
void
DisplayItemData::Disconnect()
{
if (mDisconnected) {
return;
}
mDisconnected = true;
for (uint32_t i = 0; i < mFrameList.Length(); i++) {
nsIFrame* frame = mFrameList[i];
if (frame == sDestroyedFrame) {
continue;
}
SmallPointerArray<DisplayItemData>& array = frame->DisplayItemData();
array.RemoveElement(this);
}
mLayer = nullptr;
mOptLayer = nullptr;
}
void
DisplayItemData::ClearAnimationCompositorState()
{
@ -343,10 +329,6 @@ public:
}
~LayerManagerData() {
MOZ_COUNT_DTOR(LayerManagerData);
for (auto iter = mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
iter.Get()->GetKey()->Disconnect();
}
}
#ifdef DEBUG_DISPLAY_ITEM_DATA
@ -1949,7 +1931,7 @@ FrameLayerBuilder::RemoveFrameFromLayerManager(const nsIFrame* aFrame,
#endif
for (DisplayItemData* data : aArray) {
PaintedLayer* t = data->mLayer ? data->mLayer->AsPaintedLayer() : nullptr;
PaintedLayer* t = data->mLayer->AsPaintedLayer();
if (t) {
PaintedDisplayItemLayerUserData* paintedData =
static_cast<PaintedDisplayItemLayerUserData*>(t->GetUserData(&gPaintedDisplayItemLayerUserData));
@ -1962,7 +1944,6 @@ FrameLayerBuilder::RemoveFrameFromLayerManager(const nsIFrame* aFrame,
}
}
data->Disconnect();
data->mParent->mDisplayItems.RemoveEntry(data);
}
@ -2034,7 +2015,6 @@ FrameLayerBuilder::WillEndTransaction()
}
data->ClearAnimationCompositorState();
data->Disconnect();
iter.Remove();
} else {
ComputeGeometryChangeForItem(data);
@ -2081,18 +2061,14 @@ FrameLayerBuilder::HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey
}
DisplayItemData*
FrameLayerBuilder::GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey, DisplayItemData* aOldData /* = nullptr */)
FrameLayerBuilder::GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey)
{
// If we need to build a new layer tree, then just refuse to recycle
// anything.
if (!mRetainingManager || mInvalidateAllLayers)
return nullptr;
DisplayItemData* data = aOldData;
if (!data || data->mLayer->Manager() != mRetainingManager || data->Disconnected()) {
data = GetDisplayItemData(aFrame, aDisplayItemKey);
}
MOZ_ASSERT(data == GetDisplayItemData(aFrame, aDisplayItemKey));
DisplayItemData *data = GetDisplayItemData(aFrame, aDisplayItemKey);
if (data && data->mLayer->Manager() == mRetainingManager) {
return data;
@ -3160,9 +3136,7 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO);
DisplayItemData* oldData =
mLayerBuilder->GetOldLayerForFrame(item.mItem->Frame(),
item.mItem->GetPerFrameKey(),
item.mItem->HasMergedFrames() ? nullptr : item.mItem->GetDisplayItemData());
mLayerBuilder->GetOldLayerForFrame(item.mItem->Frame(), item.mItem->GetPerFrameKey());
InvalidateForLayerChange(item.mItem, data->mLayer, oldData);
mLayerBuilder->AddPaintedDisplayItem(data, item.mItem, item.mClip,
*this, item.mLayerState,
@ -4908,8 +4882,6 @@ FrameLayerBuilder::StoreDataForFrame(nsDisplayItem* aItem, Layer* aLayer,
RefPtr<DisplayItemData> data =
new (aItem->Frame()->PresContext()) DisplayItemData(lmd, aItem->GetPerFrameKey(), aLayer);
aItem->SetDisplayItemData(data);
data->BeginUpdate(aLayer, aState, aItem);
lmd->mDisplayItems.PutEntry(data);

Просмотреть файл

@ -71,8 +71,6 @@ public:
void Invalidate() { mIsInvalid = true; }
void ClearAnimationCompositorState();
bool HasMergedFrames() const { return mFrameList.Length() > 1; }
static DisplayItemData* AssertDisplayItemData(DisplayItemData* aData);
void* operator new(size_t sz, nsPresContext* aPresContext)
@ -106,10 +104,6 @@ public:
return mRefCnt;
}
void Disconnect();
bool Disconnected() { return mDisconnected; }
private:
DisplayItemData(LayerManagerData* aParent,
uint32_t aKey,
@ -192,7 +186,6 @@ private:
bool mUsed;
bool mIsInvalid;
bool mReusedItem;
bool mDisconnected;
};
class RefCountedRegion {
@ -629,7 +622,7 @@ public:
* This could be a dedicated layer for the display item, or a PaintedLayer
* that renders many display items.
*/
DisplayItemData* GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey, DisplayItemData* aOldData = nullptr);
DisplayItemData* GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey);
protected:

Просмотреть файл

@ -2257,7 +2257,7 @@ nsDisplayListBuilder::BuildCompositorHitTestInfoIfNeeded(nsIFrame* aFrame,
}
nsDisplayCompositorHitTestInfo* item =
MakeDisplayItem<nsDisplayCompositorHitTestInfo>(this, aFrame, info);
new (this) nsDisplayCompositorHitTestInfo(this, aFrame, info);
SetCompositorHitTestInfo(item);
aList->AppendToTop(item);
@ -3531,10 +3531,9 @@ nsDisplayBackgroundImage::GetInitData(nsDisplayListBuilder* aBuilder,
};
}
nsDisplayBackgroundImage::nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder,
const InitData& aInitData,
nsDisplayBackgroundImage::nsDisplayBackgroundImage(const InitData& aInitData,
nsIFrame* aFrameForBounds)
: nsDisplayImageContainer(aBuilder, aInitData.frame)
: nsDisplayImageContainer(aInitData.builder, aInitData.frame)
, mBackgroundStyle(aInitData.backgroundStyle)
, mImage(aInitData.image)
, mDependentFrame(nullptr)
@ -3644,7 +3643,7 @@ SpecialCutoutRegionCase(nsDisplayListBuilder* aBuilder,
region.Sub(aBackgroundRect, *static_cast<nsRegion*>(cutoutRegion));
region.MoveBy(aBuilder->ToReferenceFrame(aFrame));
aList->AppendToTop(
MakeDisplayItem<nsDisplaySolidColorRegion>(aBuilder, aFrame, region, aColor));
new (aBuilder) nsDisplaySolidColorRegion(aBuilder, aFrame, region, aColor));
return true;
}
@ -3749,12 +3748,12 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
nsDisplayBackgroundColor *bgItem;
if (aSecondaryReferenceFrame) {
bgItem =
MakeDisplayItem<nsDisplayTableBackgroundColor>(aBuilder, aSecondaryReferenceFrame, bgColorRect, bg,
new (aBuilder) nsDisplayTableBackgroundColor(aBuilder, aSecondaryReferenceFrame, bgColorRect, bg,
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0),
aFrame);
} else {
bgItem =
MakeDisplayItem<nsDisplayBackgroundColor>(aBuilder, aFrame, bgColorRect, bg,
new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bgColorRect, bg,
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0));
}
bgItem->SetDependentFrame(aBuilder, dependentFrame);
@ -3766,11 +3765,11 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
if (theme->NeedToClearBackgroundBehindWidget(aFrame, aFrame->StyleDisplay()->mAppearance) &&
aBuilder->IsInChromeDocumentOrPopup() && !aBuilder->IsInTransform()) {
bgItemList.AppendToTop(
MakeDisplayItem<nsDisplayClearBackground>(aBuilder, aFrame));
new (aBuilder) nsDisplayClearBackground(aBuilder, aFrame));
}
if (aSecondaryReferenceFrame) {
nsDisplayTableThemedBackground* bgItem =
MakeDisplayItem<nsDisplayTableThemedBackground>(aBuilder,
new (aBuilder) nsDisplayTableThemedBackground(aBuilder,
aSecondaryReferenceFrame,
bgRect,
aFrame);
@ -3778,7 +3777,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
bgItemList.AppendToTop(bgItem);
} else {
nsDisplayThemedBackground* bgItem =
MakeDisplayItem<nsDisplayThemedBackground>(aBuilder, aFrame, bgRect);
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame, bgRect);
bgItem->Init(aBuilder);
bgItemList.AppendToTop(bgItem);
}
@ -3852,9 +3851,9 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
nsDisplayBackgroundImage::InitData tableData = bgData;
nsIFrame* styleFrame = tableData.frame;
tableData.frame = aSecondaryReferenceFrame;
bgItem = MakeDisplayItem<nsDisplayTableBackgroundImage>(aBuilder, tableData, styleFrame);
bgItem = new (aBuilder) nsDisplayTableBackgroundImage(tableData, styleFrame);
} else {
bgItem = MakeDisplayItem<nsDisplayBackgroundImage>(aBuilder, bgData);
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
}
}
bgItem->SetDependentFrame(aBuilder, dependentFrame);
@ -3877,9 +3876,9 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
nsIFrame* styleFrame = tableData.frame;
tableData.frame = aSecondaryReferenceFrame;
bgItem = MakeDisplayItem<nsDisplayTableBackgroundImage>(aBuilder, tableData, styleFrame);
bgItem = new (aBuilder) nsDisplayTableBackgroundImage(tableData, styleFrame);
} else {
bgItem = MakeDisplayItem<nsDisplayBackgroundImage>(aBuilder, bgData);
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
}
bgItem->SetDependentFrame(aBuilder, dependentFrame);
thisItemList.AppendToTop(bgItem);
@ -3892,12 +3891,12 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
// item with respect to asr.
if (aSecondaryReferenceFrame) {
thisItemList.AppendToTop(
MakeDisplayItem<nsDisplayTableBlendMode>(aBuilder, aSecondaryReferenceFrame, &thisItemList,
new (aBuilder) nsDisplayTableBlendMode(aBuilder, aSecondaryReferenceFrame, &thisItemList,
bg->mImage.mLayers[i].mBlendMode,
asr, i + 1, aFrame));
} else {
thisItemList.AppendToTop(
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, aFrame, &thisItemList,
new (aBuilder) nsDisplayBlendMode(aBuilder, aFrame, &thisItemList,
bg->mImage.mLayers[i].mBlendMode,
asr, i + 1));
}
@ -4400,10 +4399,9 @@ nsDisplayBackgroundImage::GetBoundsInternal(nsDisplayListBuilder* aBuilder,
aBuilder->GetBackgroundPaintFlags());
}
nsDisplayTableBackgroundImage::nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder,
const InitData& aData,
nsDisplayTableBackgroundImage::nsDisplayTableBackgroundImage(const InitData& aData,
nsIFrame* aCellFrame)
: nsDisplayBackgroundImage(aBuilder, aData, aCellFrame)
: nsDisplayBackgroundImage(aData, aCellFrame)
, mStyleFrame(aCellFrame)
, mTableType(GetTableTypeFromFrame(mStyleFrame))
{
@ -6270,7 +6268,7 @@ nsDisplayWrapList::MergeDisplayListFromItem(nsDisplayListBuilder* aBuilder,
// Create a new nsDisplayWrapList using a copy-constructor. This is done
// to preserve the information about bounds.
nsDisplayWrapList* wrapper = MakeDisplayItem<nsDisplayWrapList>(aBuilder, *wrappedItem);
nsDisplayWrapList* wrapper = new (aBuilder) nsDisplayWrapList(aBuilder, *wrappedItem);
// Set the display list pointer of the new wrapper item to the display list
// of the wrapped item.
@ -6922,7 +6920,7 @@ nsDisplayBlendContainer::CreateForMixBlendMode(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList,
const ActiveScrolledRoot* aActiveScrolledRoot)
{
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, false);
return new (aBuilder) nsDisplayBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, false);
}
/* static */ nsDisplayBlendContainer*
@ -6930,7 +6928,7 @@ nsDisplayBlendContainer::CreateForBackgroundBlendMode(nsDisplayListBuilder* aBui
nsIFrame* aFrame, nsDisplayList* aList,
const ActiveScrolledRoot* aActiveScrolledRoot)
{
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, true);
return new (aBuilder) nsDisplayBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, true);
}
nsDisplayBlendContainer::nsDisplayBlendContainer(nsDisplayListBuilder* aBuilder,
@ -6997,7 +6995,7 @@ nsDisplayTableBlendContainer::CreateForBackgroundBlendMode(nsDisplayListBuilder*
const ActiveScrolledRoot* aActiveScrolledRoot,
nsIFrame* aAncestorFrame)
{
return MakeDisplayItem<nsDisplayTableBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, true, aAncestorFrame);
return new (aBuilder) nsDisplayTableBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, true, aAncestorFrame);
}
nsDisplayOwnLayer::nsDisplayOwnLayer(nsDisplayListBuilder* aBuilder,
@ -7376,7 +7374,7 @@ nsDisplayFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBuilder,
nsDisplayList temp;
temp.AppendToTop(aImage);
return MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, aFrame, &temp, aIndex + 1);
return new (aBuilder) nsDisplayFixedPosition(aBuilder, aFrame, &temp, aIndex + 1);
}
@ -7489,7 +7487,7 @@ nsDisplayTableFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBui
nsDisplayList temp;
temp.AppendToTop(aImage);
return MakeDisplayItem<nsDisplayTableFixedPosition>(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
}
nsDisplayStickyPosition::nsDisplayStickyPosition(nsDisplayListBuilder* aBuilder,

Просмотреть файл

@ -130,14 +130,10 @@ 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:
}
/**
@ -2029,27 +2025,6 @@ protected:
class nsDisplayWrapList;
template<typename T, typename... Args>
MOZ_ALWAYS_INLINE T*
MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs)
{
T* item = new (aBuilder) T(aBuilder, mozilla::Forward<Args>(aArgs)...);
const mozilla::SmallPointerArray<mozilla::DisplayItemData>& array =
item->Frame()->DisplayItemData();
for (uint32_t i = 0; i < array.Length(); i++) {
mozilla::DisplayItemData* did = array.ElementAt(i);
if (did->GetDisplayItemKey() == item->GetPerFrameKey()) {
if (did->HasMergedFrames()) {
item->SetDisplayItemData(did);
}
break;
}
}
return item;
}
/**
* 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
@ -2141,7 +2116,6 @@ public:
if (mFrame && aFrame == mFrame) {
MOZ_ASSERT(!mFrame->HasDisplayItem(this));
mFrame = nullptr;
mDisplayItemData = nullptr;
}
}
@ -2608,8 +2582,6 @@ public:
*/
virtual void GetMergedFrames(nsTArray<nsIFrame*>* aFrames) const {}
virtual bool HasMergedFrames() const { return false; }
/**
* During the visibility computation and after TryMerge, display lists may
* return true here to flatten themselves away, removing them. This
@ -2835,12 +2807,6 @@ public:
nsDisplayListBuilder* aBuilder,
const ActiveScrolledRoot* aASR) const;
void SetDisplayItemData(mozilla::DisplayItemData* aDID) {
mDisplayItemData = aDID;
}
mozilla::DisplayItemData* GetDisplayItemData() { return mDisplayItemData; }
protected:
nsDisplayItem() = delete;
@ -2857,7 +2823,6 @@ protected:
RefPtr<struct AnimatedGeometryRoot> mAnimatedGeometryRoot;
// Result of ToReferenceFrame(mFrame), if mFrame is non-null
nsPoint mToReferenceFrame;
RefPtr<mozilla::DisplayItemData> mDisplayItemData;
// This is the rectangle that needs to be painted.
// Display item construction sets this to the dirty rect.
// nsDisplayList::ComputeVisibility sets this to the visible region
@ -3421,6 +3386,10 @@ 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.
@ -3431,13 +3400,6 @@ 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;
@ -3491,7 +3453,7 @@ protected:
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
PresShell()->IsPaintingFrameCounts()) { \
aLists.Outlines()->AppendToTop( \
MakeDisplayItem<nsDisplayReflowCount>(aBuilder, this, _name)); \
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name)); \
} \
PR_END_MACRO
@ -3500,7 +3462,7 @@ protected:
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
PresShell()->IsPaintingFrameCounts()) { \
aLists.Outlines()->AppendToTop( \
MakeDisplayItem<nsDisplayReflowCount>(aBuilder, this, _name, _color)); \
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name, _color)); \
} \
PR_END_MACRO
@ -3872,8 +3834,7 @@ public:
const nsRect& aBackgroundRect,
const nsStyleBackground* aBackgroundStyle);
explicit nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder,
const InitData& aInitData,
explicit nsDisplayBackgroundImage(const InitData& aInitData,
nsIFrame* aFrameForBounds = nullptr);
virtual ~nsDisplayBackgroundImage();
@ -4067,7 +4028,7 @@ TableType GetTableTypeFromFrame(nsIFrame* aFrame);
*/
class nsDisplayTableBackgroundImage : public nsDisplayBackgroundImage {
public:
nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder, const InitData& aInitData, nsIFrame* aCellFrame);
nsDisplayTableBackgroundImage(const InitData& aInitData, nsIFrame* aCellFrame);
virtual uint32_t GetPerFrameKey() const override {
return (mLayer << (TYPE_BITS + static_cast<uint8_t>(TableTypeBits::COUNT))) |
@ -4991,11 +4952,6 @@ public:
aFrames->AppendElements(mMergedFrames);
}
virtual bool HasMergedFrames() const override
{
return !mMergedFrames.IsEmpty();
}
virtual bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override
{
return true;
@ -5148,7 +5104,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
MOZ_COUNT_CTOR(nsDisplayOpacity);
return MakeDisplayItem<nsDisplayOpacity>(aBuilder, *this);
return new (aBuilder) nsDisplayOpacity(aBuilder, *this);
}
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
@ -5228,7 +5184,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
MOZ_COUNT_CTOR(nsDisplayBlendMode);
return MakeDisplayItem<nsDisplayBlendMode>(aBuilder, *this);
return new (aBuilder) nsDisplayBlendMode(aBuilder, *this);
}
nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
@ -5292,7 +5248,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
return MakeDisplayItem<nsDisplayTableBlendMode>(aBuilder, *this);
return new (aBuilder) nsDisplayTableBlendMode(aBuilder, *this);
}
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
@ -5329,7 +5285,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
MOZ_COUNT_CTOR(nsDisplayBlendContainer);
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, *this);
return new (aBuilder) nsDisplayBlendContainer(aBuilder, *this);
}
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
@ -5388,7 +5344,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
return MakeDisplayItem<nsDisplayTableBlendContainer>(aBuilder, *this);
return new (aBuilder) nsDisplayTableBlendContainer(aBuilder, *this);
}
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
@ -5626,7 +5582,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
MOZ_COUNT_CTOR(nsDisplayStickyPosition);
return MakeDisplayItem<nsDisplayStickyPosition>(aBuilder, *this);
return new (aBuilder) nsDisplayStickyPosition(aBuilder, *this);
}
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
@ -5680,7 +5636,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
return MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, *this);
return new (aBuilder) nsDisplayFixedPosition(aBuilder, *this);
}
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
@ -5738,7 +5694,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
return MakeDisplayItem<nsDisplayTableFixedPosition>(aBuilder, *this);
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, *this);
}
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
@ -5762,6 +5718,7 @@ protected:
, mTableType(aOther.mTableType)
{}
nsIFrame* mAncestorFrame;
TableType mTableType;
};
@ -5942,7 +5899,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
MOZ_COUNT_CTOR(nsDisplayMask);
return MakeDisplayItem<nsDisplayMask>(aBuilder, *this);
return new (aBuilder) nsDisplayMask(aBuilder, *this);
}
NS_DISPLAY_DECL_NAME("Mask", TYPE_MASK)
@ -6031,7 +5988,7 @@ public:
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
MOZ_COUNT_CTOR(nsDisplayFilter);
return MakeDisplayItem<nsDisplayFilter>(aBuilder, *this);
return new (aBuilder) nsDisplayFilter(aBuilder, *this);
}
NS_DISPLAY_DECL_NAME("Filter", TYPE_FILTER)

Просмотреть файл

@ -260,7 +260,7 @@ SVGGeometryFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
DisplayOutline(aBuilder, aLists);
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplaySVGGeometry>(aBuilder, this));
new (aBuilder) nsDisplaySVGGeometry(aBuilder, this));
}
//----------------------------------------------------------------------

Просмотреть файл

@ -3204,7 +3204,7 @@ SVGTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
DisplayOutline(aBuilder, aLists);
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplaySVGText>(aBuilder, this));
new (aBuilder) 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(MakeDisplayItem<nsDisplaySVGWrapper>(aBuilder, this, &newList));
aLists.Content()->AppendToTop(new (aBuilder) nsDisplaySVGWrapper(aBuilder, this, &newList));
} else if (IsVisibleForPainting(aBuilder) || !aBuilder->IsForPainting()) {
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayOuterSVG>(aBuilder, this));
new (aBuilder) nsDisplayOuterSVG(aBuilder, this));
}
}

Просмотреть файл

@ -391,7 +391,8 @@ nsTableCellFrame::ProcessBorders(nsTableFrame* aFrame,
if (!GetContentEmpty() ||
StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
aLists.BorderBackground()->AppendToTop(MakeDisplayItem<nsDisplayBorder>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayBorder(aBuilder, this));
}
return NS_OK;
@ -495,7 +496,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
bool hasBoxShadow = !!StyleEffects()->mBoxShadow;
if (hasBoxShadow) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this));
}
// display background if we need to.
@ -511,7 +512,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// display inset box-shadows if we need to.
if (hasBoxShadow) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, this));
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this));
}
// display borders if we need to
@ -519,8 +520,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// and display the selection border if we need to
if (IsSelected()) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayTableCellSelection>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, aFrame));
new (aBuilder) 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(
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, aFrame));
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, aFrame));
}
}
@ -1616,13 +1616,13 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
if (table->IsBorderCollapse()) {
if (table->HasBCBorders()) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayTableBorderCollapse>(aBuilder, table));
new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table));
}
} else {
const nsStyleBorder* borderStyle = aFrame->StyleBorder();
if (borderStyle->HasBorder()) {
aLists.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayBorder>(aBuilder, table));
new (aBuilder) nsDisplayBorder(aBuilder, table));
}
}
}

Просмотреть файл

@ -1348,11 +1348,11 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
#ifdef DEBUG_LAYOUT
if (mState & NS_STATE_CURRENTLY_IN_DEBUG) {
destination.BorderBackground()->AppendToTop(
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintXULDebugBackground,
destination.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayGeneric(aBuilder, this, PaintXULDebugBackground,
"XULDebugBackground"));
destination.Outlines()->AppendToTop(
MakeDisplayItem<nsDisplayXULDebug>(aBuilder, this));
destination.Outlines()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &masterList, ownLayerASR,
nsDisplayOwnLayerFlags::eNone,
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
mozilla::layers::ScrollThumbData{}, true, true));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayOwnLayer(aBuilder, this, &masterList, ownLayerASR,
nsDisplayOwnLayerFlags::eNone,
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
mozilla::layers::ScrollThumbData{}, true, true));
}
}
@ -2086,13 +2086,14 @@ public:
virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList) override {
return MakeDisplayItem<nsDisplayXULEventRedirector>(aBuilder, aFrame, aList,
mTargetFrame);
return new (aBuilder)
nsDisplayXULEventRedirector(aBuilder, aFrame, aList, mTargetFrame);
}
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) override {
return MakeDisplayItem<nsDisplayXULEventRedirector>(aBuilder, aItem->Frame(), aItem,
mTargetFrame);
return new (aBuilder)
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(
MakeDisplayItem<nsDisplayXULGroupBorder>(aBuilder, this));
aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayXULGroupBorder(aBuilder, this));
DisplayOutline(aBuilder, aLists);
}

Просмотреть файл

@ -342,7 +342,7 @@ nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsDisplayList list;
list.AppendToTop(
MakeDisplayItem<nsDisplayXULImage>(aBuilder, this));
new (aBuilder) nsDisplayXULImage(aBuilder, this));
CreateOwnLayerIfNeeded(aBuilder, &list);

Просмотреть файл

@ -112,8 +112,8 @@ nsLeafBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!aBuilder->IsForEventDelivery() || !IsVisibleForPainting(aBuilder))
return;
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
aLists.Content()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
aLists.Outlines()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &masterList, ownLayerASR,
flags, scrollTargetId,
ScrollThumbData{scrollDirection,
GetThumbRatio(),
thumbStart,
thumbLength,
isAsyncDraggable,
sliderTrackStart,
sliderTrackLength}));
aLists.Content()->AppendToTop(new (aBuilder)
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(
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
aLists.Outlines()->AppendToTop(new (aBuilder)
nsDisplayEventReceiver(aBuilder, this));
return;
}
}

Просмотреть файл

@ -373,8 +373,8 @@ nsTextBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsLeafBoxFrame::BuildDisplayList(aBuilder, aLists);
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayXULTextBox>(aBuilder, this));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayXULTextBox(aBuilder, this));
}
void

Просмотреть файл

@ -2845,7 +2845,7 @@ nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!mView || !GetContent ()->GetComposedDoc()->GetWindow())
return;
nsDisplayItem* item = MakeDisplayItem<nsDisplayTreeBody>(aBuilder, this);
nsDisplayItem* item = new (aBuilder) 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(
MakeDisplayItem<nsDisplayXULTreeColSplitterTarget>(aBuilder, this));
aLists.Content()->AppendToTop(new (aBuilder)
nsDisplayXULTreeColSplitterTarget(aBuilder, this));
}
nsresult