Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas

This commit is contained in:
Matt Woodrow
2018-02-13 13:43:28 +13:00
parent 79868f24c0
commit 2bcbca93c9
49 changed files with 248 additions and 232 deletions

View File

@@ -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));
}
}