Bug 584282. Add nsDisplayItem::mToReferenceFrame and initialize it in the constructor. r=tnikkel,a=dbaron

This commit is contained in:
Robert O'Callahan 2010-08-13 22:01:13 +12:00
Родитель 9b34226751
Коммит 816c4f5fff
49 изменённых файлов: 353 добавлений и 265 удалений

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

@ -626,8 +626,9 @@ RegisterThemeWidgetGeometry(nsIFrame* aFrame)
borderBox.ToNearestPixels(presContext->AppUnitsPerDevPixel()));
}
nsDisplayBackground::nsDisplayBackground(nsIFrame* aFrame)
: nsDisplayItem(aFrame)
nsDisplayBackground::nsDisplayBackground(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)
{
MOZ_COUNT_CTOR(nsDisplayBackground);
const nsStyleDisplay* disp = mFrame->GetStyleDisplay();
@ -1018,13 +1019,15 @@ nsDisplayBoxShadowInner::ComputeVisibility(nsDisplayListBuilder* aBuilder,
return PR_TRUE;
}
nsDisplayWrapList::nsDisplayWrapList(nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayItem(aFrame) {
nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayItem(aBuilder, aFrame) {
mList.AppendToTop(aList);
}
nsDisplayWrapList::nsDisplayWrapList(nsIFrame* aFrame, nsDisplayItem* aItem)
: nsDisplayItem(aFrame) {
nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayItem* aItem)
: nsDisplayItem(aBuilder, aFrame) {
mList.AppendToTop(aItem);
}
@ -1169,8 +1172,9 @@ nsresult nsDisplayWrapper::WrapListsInPlace(nsDisplayListBuilder* aBuilder,
return WrapEachDisplayItem(aBuilder, aLists.Outlines(), this);
}
nsDisplayOpacity::nsDisplayOpacity(nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aFrame, aList) {
nsDisplayOpacity::nsDisplayOpacity(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aBuilder, aFrame, aList) {
MOZ_COUNT_CTOR(nsDisplayOpacity);
}
@ -1236,8 +1240,9 @@ PRBool nsDisplayOpacity::TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem*
return PR_TRUE;
}
nsDisplayOwnLayer::nsDisplayOwnLayer(nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aFrame, aList) {
nsDisplayOwnLayer::nsDisplayOwnLayer(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aBuilder, aFrame, aList) {
MOZ_COUNT_CTOR(nsDisplayOwnLayer);
}
@ -1256,16 +1261,18 @@ nsDisplayOwnLayer::BuildLayer(nsDisplayListBuilder* aBuilder,
return layer.forget();
}
nsDisplayClip::nsDisplayClip(nsIFrame* aFrame, nsIFrame* aClippingFrame,
nsDisplayItem* aItem, const nsRect& aRect)
: nsDisplayWrapList(aFrame, aItem),
nsDisplayClip::nsDisplayClip(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsIFrame* aClippingFrame,
nsDisplayItem* aItem, const nsRect& aRect)
: nsDisplayWrapList(aBuilder, aFrame, aItem),
mClippingFrame(aClippingFrame), mClip(aRect) {
MOZ_COUNT_CTOR(nsDisplayClip);
}
nsDisplayClip::nsDisplayClip(nsIFrame* aFrame, nsIFrame* aClippingFrame,
nsDisplayList* aList, const nsRect& aRect)
: nsDisplayWrapList(aFrame, aList),
nsDisplayClip::nsDisplayClip(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsIFrame* aClippingFrame,
nsDisplayList* aList, const nsRect& aRect)
: nsDisplayWrapList(aBuilder, aFrame, aList),
mClippingFrame(aClippingFrame), mClip(aRect) {
MOZ_COUNT_CTOR(nsDisplayClip);
}
@ -1317,12 +1324,14 @@ PRBool nsDisplayClip::TryMerge(nsDisplayListBuilder* aBuilder,
nsDisplayWrapList* nsDisplayClip::WrapWithClone(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) {
return new (aBuilder)
nsDisplayClip(aItem->GetUnderlyingFrame(), mClippingFrame, aItem, mClip);
nsDisplayClip(aBuilder, aItem->GetUnderlyingFrame(), mClippingFrame, aItem, mClip);
}
nsDisplayZoom::nsDisplayZoom(nsIFrame* aFrame, nsDisplayList* aList,
nsDisplayZoom::nsDisplayZoom(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList,
PRInt32 aAPD, PRInt32 aParentAPD)
: nsDisplayOwnLayer(aFrame, aList), mAPD(aAPD), mParentAPD(aParentAPD) {
: nsDisplayOwnLayer(aBuilder, aFrame, aList), mAPD(aAPD),
mParentAPD(aParentAPD) {
MOZ_COUNT_CTOR(nsDisplayZoom);
}
@ -1779,8 +1788,9 @@ nsRect nsDisplayTransform::UntransformRect(const nsRect &aUntransformedBounds,
}
#ifdef MOZ_SVG
nsDisplaySVGEffects::nsDisplaySVGEffects(nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aFrame, aList), mEffectsFrame(aFrame),
nsDisplaySVGEffects::nsDisplaySVGEffects(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aBuilder, aFrame, aList), mEffectsFrame(aFrame),
mBounds(aFrame->GetOverflowRectRelativeToSelf())
{
MOZ_COUNT_CTOR(nsDisplaySVGEffects);

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

@ -436,7 +436,12 @@ public:
// This is never instantiated directly (it has pure virtual methods), so no
// need to count constructors and destructors.
nsDisplayItem(nsIFrame* aFrame) : mFrame(aFrame) {}
nsDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) :
mFrame(aFrame) {
if (aFrame) {
mToReferenceFrame = aBuilder->ToReferenceFrame(aFrame);
}
}
virtual ~nsDisplayItem() {}
void* operator new(size_t aSize,
@ -635,6 +640,11 @@ public:
PRBool RecomputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion);
const nsPoint& ToReferenceFrame() {
NS_ASSERTION(mFrame, "No frame?");
return mToReferenceFrame;
}
protected:
friend class nsDisplayList;
@ -643,6 +653,8 @@ protected:
}
nsIFrame* mFrame;
// Result of ToReferenceFrame(mFrame), if mFrame is non-null
nsPoint mToReferenceFrame;
// This is the rectangle that needs to be painted.
// nsDisplayList::ComputeVisibility sets this to the visible region
// of the item by intersecting the current visible region with the bounds
@ -1054,8 +1066,9 @@ public:
typedef void (* PaintCallback)(nsIFrame* aFrame, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect, nsPoint aFramePt);
nsDisplayGeneric(nsIFrame* aFrame, PaintCallback aPaint, const char* aName, Type aType)
: nsDisplayItem(aFrame), mPaint(aPaint)
nsDisplayGeneric(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
PaintCallback aPaint, const char* aName, Type aType)
: nsDisplayItem(aBuilder, aFrame), mPaint(aPaint)
#ifdef DEBUG
, mName(aName)
#endif
@ -1096,9 +1109,10 @@ protected:
*/
class nsDisplayReflowCount : public nsDisplayItem {
public:
nsDisplayReflowCount(nsIFrame* aFrame, const char* aFrameName,
nsDisplayReflowCount(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
const char* aFrameName,
PRUint32 aColor = 0)
: nsDisplayItem(aFrame),
: nsDisplayItem(aBuilder, aFrame),
mFrameName(aFrameName),
mColor(aColor)
{
@ -1128,8 +1142,8 @@ protected:
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
PresContext()->PresShell()->IsPaintingFrameCounts()) { \
nsresult _rv = \
aLists.Outlines()->AppendNewToTop(new (aBuilder) \
nsDisplayReflowCount(this, _name)); \
aLists.Outlines()->AppendNewToTop( \
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name)); \
NS_ENSURE_SUCCESS(_rv, _rv); \
} \
PR_END_MACRO
@ -1139,9 +1153,8 @@ protected:
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
PresContext()->PresShell()->IsPaintingFrameCounts()) { \
nsresult _rv = \
aLists.Outlines()->AppendNewToTop(new (aBuilder) \
nsDisplayReflowCount(this, _name, \
_color)); \
aLists.Outlines()->AppendNewToTop( \
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name, _color)); \
NS_ENSURE_SUCCESS(_rv, _rv); \
} \
PR_END_MACRO
@ -1167,8 +1180,9 @@ protected:
class nsDisplayCaret : public nsDisplayItem {
public:
nsDisplayCaret(nsIFrame* aCaretFrame, nsCaret *aCaret)
: nsDisplayItem(aCaretFrame), mCaret(aCaret) {
nsDisplayCaret(nsDisplayListBuilder* aBuilder, nsIFrame* aCaretFrame,
nsCaret *aCaret)
: nsDisplayItem(aBuilder, aCaretFrame), mCaret(aCaret) {
MOZ_COUNT_CTOR(nsDisplayCaret);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1192,7 +1206,8 @@ protected:
*/
class nsDisplayBorder : public nsDisplayItem {
public:
nsDisplayBorder(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayBorder(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayBorder);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1220,8 +1235,9 @@ public:
*/
class nsDisplaySolidColor : public nsDisplayItem {
public:
nsDisplaySolidColor(nsIFrame* aFrame, const nsRect& aBounds, nscolor aColor)
: nsDisplayItem(aFrame), mBounds(aBounds), mColor(aColor) {
nsDisplaySolidColor(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
const nsRect& aBounds, nscolor aColor)
: nsDisplayItem(aBuilder, aFrame), mBounds(aBounds), mColor(aColor) {
MOZ_COUNT_CTOR(nsDisplaySolidColor);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1256,7 +1272,7 @@ private:
*/
class nsDisplayBackground : public nsDisplayItem {
public:
nsDisplayBackground(nsIFrame* aFrame);
nsDisplayBackground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayBackground() {
MOZ_COUNT_DTOR(nsDisplayBackground);
@ -1289,7 +1305,8 @@ protected:
*/
class nsDisplayBoxShadowOuter : public nsDisplayItem {
public:
nsDisplayBoxShadowOuter(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayBoxShadowOuter(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayBoxShadowOuter);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1313,7 +1330,8 @@ private:
*/
class nsDisplayBoxShadowInner : public nsDisplayItem {
public:
nsDisplayBoxShadowInner(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayBoxShadowInner(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayBoxShadowInner);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1336,7 +1354,8 @@ private:
*/
class nsDisplayOutline : public nsDisplayItem {
public:
nsDisplayOutline(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayOutline(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayOutline);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1357,7 +1376,8 @@ public:
*/
class nsDisplayEventReceiver : public nsDisplayItem {
public:
nsDisplayEventReceiver(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayEventReceiver(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayEventReceiver);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1396,8 +1416,10 @@ public:
/**
* Takes all the items from aList and puts them in our list.
*/
nsDisplayWrapList(nsIFrame* aFrame, nsDisplayList* aList);
nsDisplayWrapList(nsIFrame* aFrame, nsDisplayItem* aItem);
nsDisplayWrapList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList);
nsDisplayWrapList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayItem* aItem);
virtual ~nsDisplayWrapList();
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames);
@ -1477,7 +1499,8 @@ protected:
*/
class nsDisplayOpacity : public nsDisplayWrapList {
public:
nsDisplayOpacity(nsIFrame* aFrame, nsDisplayList* aList);
nsDisplayOpacity(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayOpacity();
#endif
@ -1499,7 +1522,8 @@ public:
*/
class nsDisplayOwnLayer : public nsDisplayWrapList {
public:
nsDisplayOwnLayer(nsIFrame* aFrame, nsDisplayList* aList);
nsDisplayOwnLayer(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayOwnLayer();
#endif
@ -1531,9 +1555,11 @@ public:
* frame for this content, e.g. the frame whose z-index we have.
* @param aClippingFrame the frame that is inducing the clipping.
*/
nsDisplayClip(nsIFrame* aFrame, nsIFrame* aClippingFrame,
nsDisplayClip(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsIFrame* aClippingFrame,
nsDisplayItem* aItem, const nsRect& aRect);
nsDisplayClip(nsIFrame* aFrame, nsIFrame* aClippingFrame,
nsDisplayClip(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsIFrame* aClippingFrame,
nsDisplayList* aList, const nsRect& aRect);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayClip();
@ -1576,7 +1602,8 @@ public:
* @param aParentAPD is the app units per dev pixel ratio of the parent
* document.
*/
nsDisplayZoom(nsIFrame* aFrame, nsDisplayList* aList,
nsDisplayZoom(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList,
PRInt32 aAPD, PRInt32 aParentAPD);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayZoom();
@ -1606,7 +1633,8 @@ private:
*/
class nsDisplaySVGEffects : public nsDisplayWrapList {
public:
nsDisplaySVGEffects(nsIFrame* aFrame, nsDisplayList* aList);
nsDisplaySVGEffects(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplaySVGEffects();
#endif
@ -1644,8 +1672,9 @@ public:
/* Constructor accepts a display list, empties it, and wraps it up. It also
* ferries the underlying frame to the nsDisplayItem constructor.
*/
nsDisplayTransform(nsIFrame *aFrame, nsDisplayList *aList) :
nsDisplayItem(aFrame), mStoredList(aFrame, aList)
nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame,
nsDisplayList *aList) :
nsDisplayItem(aBuilder, aFrame), mStoredList(aBuilder, aFrame, aList)
{
MOZ_COUNT_CTOR(nsDisplayTransform);
}

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

@ -5386,7 +5386,8 @@ PresShell::ClipListToRange(nsDisplayListBuilder *aBuilder,
// wrap the item in an nsDisplayClip so that it can be clipped to
// the selection. If the allocation fails, fall through and delete
// the item below.
itemToInsert = new (aBuilder)nsDisplayClip(frame, frame, i, textRect);
itemToInsert = new (aBuilder)
nsDisplayClip(aBuilder, frame, frame, i, textRect);
}
}
// Don't try to descend into subdocuments.
@ -5733,8 +5734,8 @@ PresShell::AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
nsIFrame* aFrame,
const nsRect& aBounds)
{
return aList.AppendNewToBottom(
new (&aBuilder) nsDisplaySolidColor(aFrame, aBounds, NS_RGB(115, 115, 115)));
return aList.AppendNewToBottom(new (&aBuilder)
nsDisplaySolidColor(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
}
static PRBool
@ -5790,7 +5791,7 @@ nsresult PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
}
return aList.AppendNewToBottom(
new (&aBuilder) nsDisplaySolidColor(aFrame, aBounds, bgcolor));
new (&aBuilder) nsDisplaySolidColor(&aBuilder, aFrame, aBounds, bgcolor));
}
void PresShell::UpdateCanvasBackground()

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

@ -93,8 +93,9 @@ nsButtonFrameRenderer::isDisabled()
class nsDisplayButtonBoxShadowOuter : public nsDisplayItem {
public:
nsDisplayButtonBoxShadowOuter(nsButtonFrameRenderer* aRenderer)
: nsDisplayItem(aRenderer->GetFrame()), mBFR(aRenderer) {
nsDisplayButtonBoxShadowOuter(nsDisplayListBuilder* aBuilder,
nsButtonFrameRenderer* aRenderer)
: nsDisplayItem(aBuilder, aRenderer->GetFrame()), mBFR(aRenderer) {
MOZ_COUNT_CTOR(nsDisplayButtonBoxShadowOuter);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -130,8 +131,9 @@ nsDisplayButtonBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder,
class nsDisplayButtonBorderBackground : public nsDisplayItem {
public:
nsDisplayButtonBorderBackground(nsButtonFrameRenderer* aRenderer)
: nsDisplayItem(aRenderer->GetFrame()), mBFR(aRenderer) {
nsDisplayButtonBorderBackground(nsDisplayListBuilder* aBuilder,
nsButtonFrameRenderer* aRenderer)
: nsDisplayItem(aBuilder, aRenderer->GetFrame()), mBFR(aRenderer) {
MOZ_COUNT_CTOR(nsDisplayButtonBorderBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -153,8 +155,9 @@ private:
class nsDisplayButtonForeground : public nsDisplayItem {
public:
nsDisplayButtonForeground(nsButtonFrameRenderer* aRenderer)
: nsDisplayItem(aRenderer->GetFrame()), mBFR(aRenderer) {
nsDisplayButtonForeground(nsDisplayListBuilder* aBuilder,
nsButtonFrameRenderer* aRenderer)
: nsDisplayItem(aBuilder, aRenderer->GetFrame()), mBFR(aRenderer) {
MOZ_COUNT_CTOR(nsDisplayButtonForeground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -202,16 +205,16 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
{
if (mFrame->GetStyleBorder()->mBoxShadow) {
nsresult rv = aBackground->AppendNewToTop(new (aBuilder)
nsDisplayButtonBoxShadowOuter(this));
nsDisplayButtonBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
nsresult rv = aBackground->AppendNewToTop(new (aBuilder)
nsDisplayButtonBorderBackground(this));
nsDisplayButtonBorderBackground(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
return aForeground->AppendNewToTop(new (aBuilder)
nsDisplayButtonForeground(this));
nsDisplayButtonForeground(aBuilder, this));
}
void

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

@ -1313,8 +1313,9 @@ nsComboboxControlFrame::UpdateRecentIndex(PRInt32 aIndex)
class nsDisplayComboboxFocus : public nsDisplayItem {
public:
nsDisplayComboboxFocus(nsComboboxControlFrame* aFrame)
: nsDisplayItem(aFrame) {
nsDisplayComboboxFocus(nsDisplayListBuilder* aBuilder,
nsComboboxControlFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayComboboxFocus);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1367,8 +1368,8 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if ((!IsThemed(disp) ||
!presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, this, disp->mAppearance)) &&
mDisplayFrame && IsVisibleForPainting(aBuilder)) {
nsresult rv = aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayComboboxFocus(this));
nsresult rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayComboboxFocus(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
}

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

@ -176,8 +176,9 @@ nsFieldSetFrame::SetInitialChildList(nsIAtom* aListName,
class nsDisplayFieldSetBorderBackground : public nsDisplayItem {
public:
nsDisplayFieldSetBorderBackground(nsFieldSetFrame* aFrame)
: nsDisplayItem(aFrame) {
nsDisplayFieldSetBorderBackground(nsDisplayListBuilder* aBuilder,
nsFieldSetFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayFieldSetBorderBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -222,14 +223,14 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (IsVisibleForPainting(aBuilder)) {
if (GetStyleBorder()->mBoxShadow) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowOuter(this));
nsDisplayBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
// don't bother checking to see if we really have a border or background.
// we usually will have a border.
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayFieldSetBorderBackground(this));
nsDisplayFieldSetBorderBackground(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
rv = DisplayOutlineUnconditional(aBuilder, aLists);

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

@ -1007,7 +1007,7 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// box-shadow
if (GetStyleBorder()->mBoxShadow) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowOuter(this));
nsDisplayBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1031,14 +1031,12 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Disabled file controls don't pass mouse events to their children, so we
// put an invisible item in the display list above the children
// just to catch events
// REVIEW: I'm not sure why we do this, but that's what nsFileControlFrame::
// GetFrameForPoint was doing
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled) &&
IsVisibleForPainting(aBuilder)) {
nsDisplayItem* item = new (aBuilder) nsDisplayEventReceiver(this);
if (!item)
return NS_ERROR_OUT_OF_MEMORY;
aLists.Content()->AppendToTop(item);
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
if (NS_FAILED(rv))
return rv;
}
return DisplaySelectionOverlay(aBuilder, aLists);

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

@ -153,7 +153,7 @@ nsGfxCheckboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return NS_OK; // No need to paint the checkmark. The theme will do it.
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this,
nsDisplayGeneric(aBuilder, this,
IsIndeterminate()
? PaintIndeterminateMark : PaintCheckMark,
"CheckedCheckbox",

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

@ -120,6 +120,7 @@ nsGfxRadioControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, PaintCheckedRadioButton, "CheckedRadioButton",
nsDisplayGeneric(aBuilder, this, PaintCheckedRadioButton,
"CheckedRadioButton",
nsDisplayItem::TYPE_CHECKED_RADIOBUTTON));
}

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

@ -241,7 +241,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()->AppendNewToBottom(
new (aBuilder) nsDisplaySolidColor(
new (aBuilder) nsDisplaySolidColor(aBuilder,
this, nsRect(aBuilder->ToReferenceFrame(this), GetSize()),
mLastDropdownBackstopColor));
}

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

@ -92,10 +92,12 @@ nsSelectsAreaFrame::IsOptionElementFrame(nsIFrame *aFrame)
*/
class nsDisplayOptionEventGrabber : public nsDisplayWrapList {
public:
nsDisplayOptionEventGrabber(nsIFrame* aFrame, nsDisplayItem* aItem)
: nsDisplayWrapList(aFrame, aItem) {}
nsDisplayOptionEventGrabber(nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aFrame, aList) {}
nsDisplayOptionEventGrabber(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayItem* aItem)
: nsDisplayWrapList(aBuilder, aFrame, aItem) {}
nsDisplayOptionEventGrabber(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aBuilder, aFrame, aList) {}
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames);
NS_DISPLAY_DECL_NAME("OptionEventGrabber", TYPE_OPTION_EVENT_GRABBER)
@ -128,7 +130,8 @@ void nsDisplayOptionEventGrabber::HitTest(nsDisplayListBuilder* aBuilder,
nsDisplayWrapList* nsDisplayOptionEventGrabber::WrapWithClone(
nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) {
return new (aBuilder) nsDisplayOptionEventGrabber(aItem->GetUnderlyingFrame(), aItem);
return new (aBuilder)
nsDisplayOptionEventGrabber(aBuilder, aItem->GetUnderlyingFrame(), aItem);
}
class nsOptionEventGrabberWrapper : public nsDisplayWrapper
@ -139,11 +142,11 @@ public:
nsIFrame* aFrame, nsDisplayList* aList) {
// We can't specify the underlying frame here. We need this list to be
// exploded if sorted.
return new (aBuilder) nsDisplayOptionEventGrabber(nsnull, aList);
return new (aBuilder) nsDisplayOptionEventGrabber(aBuilder, nsnull, aList);
}
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) {
return new (aBuilder) nsDisplayOptionEventGrabber(aItem->GetUnderlyingFrame(), aItem);
return new (aBuilder) nsDisplayOptionEventGrabber(aBuilder, aItem->GetUnderlyingFrame(), aItem);
}
};
@ -160,7 +163,9 @@ static nsListControlFrame* GetEnclosingListFrame(nsIFrame* aSelectsAreaFrame)
class nsDisplayListFocus : public nsDisplayItem {
public:
nsDisplayListFocus(nsSelectsAreaFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayListFocus(nsDisplayListBuilder* aBuilder,
nsSelectsAreaFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayListFocus);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -214,7 +219,7 @@ nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
// because then the list's scrollframe won't clip it (the scrollframe
// only clips contained descendants).
return aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayListFocus(this));
nsDisplayListFocus(aBuilder, this));
}
return NS_OK;

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

@ -184,7 +184,8 @@ nsBulletFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
class nsDisplayBullet : public nsDisplayItem {
public:
nsDisplayBullet(nsBulletFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayBullet(nsDisplayListBuilder* aBuilder, nsBulletFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayBullet);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -219,7 +220,8 @@ nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DO_GLOBAL_REFLOW_COUNT_DSP("nsBulletFrame");
return aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplayBullet(this));
return aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayBullet(aBuilder, this));
}
void

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

@ -276,8 +276,8 @@ nsDisplayCanvasBackground::Paint(nsDisplayListBuilder* aBuilder,
*/
class nsDisplayCanvasFocus : public nsDisplayItem {
public:
nsDisplayCanvasFocus(nsCanvasFrame *aFrame)
: nsDisplayItem(aFrame)
nsDisplayCanvasFocus(nsDisplayListBuilder* aBuilder, nsCanvasFrame *aFrame)
: nsDisplayItem(aBuilder, aFrame)
{
MOZ_COUNT_CTOR(nsDisplayCanvasFocus);
}
@ -325,7 +325,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// calling DisplayBorderBackgroundOutline.
if (IsVisibleForPainting(aBuilder)) {
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayCanvasBackground(this));
nsDisplayCanvasBackground(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -362,7 +362,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayCanvasFocus(this));
nsDisplayCanvasFocus(aBuilder, this));
}
void

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

@ -165,8 +165,8 @@ protected:
*/
class nsDisplayCanvasBackground : public nsDisplayBackground {
public:
nsDisplayCanvasBackground(nsIFrame *aFrame)
: nsDisplayBackground(aFrame)
nsDisplayCanvasBackground(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame)
: nsDisplayBackground(aBuilder, aFrame)
{
mExtraBackgroundColor = NS_RGBA(0,0,0,0);
}

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

@ -1086,7 +1086,7 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
NS_ENSURE_SUCCESS(rv, rv);
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintColumnRule, "ColumnRule",
nsDisplayGeneric(aBuilder, this, ::PaintColumnRule, "ColumnRule",
nsDisplayItem::TYPE_COLUMN_RULE));
nsIFrame* kid = mFrames.FirstChild();

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

@ -825,8 +825,9 @@ nsFrame::DisplaySelection(nsPresContext* aPresContext, PRBool isOkToTurnOn)
class nsDisplaySelectionOverlay : public nsDisplayItem {
public:
nsDisplaySelectionOverlay(nsFrame* aFrame, PRInt16 aSelectionValue)
: nsDisplayItem(aFrame), mSelectionValue(aSelectionValue) {
nsDisplaySelectionOverlay(nsDisplayListBuilder* aBuilder,
nsFrame* aFrame, PRInt16 aSelectionValue)
: nsDisplayItem(aBuilder, aFrame), mSelectionValue(aSelectionValue) {
MOZ_COUNT_CTOR(nsDisplaySelectionOverlay);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -929,7 +930,7 @@ nsFrame::DisplaySelectionOverlay(nsDisplayListBuilder* aBuilder,
}
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplaySelectionOverlay(this, selectionValue));
nsDisplaySelectionOverlay(aBuilder, this, selectionValue));
}
nsresult
@ -939,7 +940,8 @@ nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
if (GetStyleOutline()->GetOutlineStyle() == NS_STYLE_BORDER_STYLE_NONE)
return NS_OK;
return aLists.Outlines()->AppendNewToTop(new (aBuilder) nsDisplayOutline(this));
return aLists.Outlines()->AppendNewToTop(
new (aBuilder) nsDisplayOutline(aBuilder, this));
}
nsresult
@ -960,7 +962,7 @@ nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aList->AppendNewToTop(
new (aBuilder) nsDisplayCaret(this, aBuilder->GetCaret()));
new (aBuilder) nsDisplayCaret(aBuilder, this, aBuilder->GetCaret()));
}
nscolor
@ -990,7 +992,7 @@ nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
if (aBuilder->IsForEventDelivery() || aForceBackground ||
!GetStyleBackground()->IsTransparent() || GetStyleDisplay()->mAppearance) {
return aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBackground(this));
nsDisplayBackground(aBuilder, this));
}
return NS_OK;
}
@ -1009,7 +1011,7 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
PRBool hasBoxShadow = GetEffectiveBoxShadows() != nsnull;
if (hasBoxShadow) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowOuter(this));
nsDisplayBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1019,13 +1021,13 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
if (hasBoxShadow) {
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowInner(this));
nsDisplayBoxShadowInner(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
if (HasBorder()) {
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBorder(this));
nsDisplayBorder(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1128,13 +1130,13 @@ public:
// We are not a stacking context root. There is no valid underlying
// frame for the whole list. These items are all in-flow descendants so
// we can safely just clip them.
return new (aBuilder) nsDisplayClip(nsnull, mContainer, aList, mRect);
return new (aBuilder) nsDisplayClip(aBuilder, nsnull, mContainer, aList, mRect);
}
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) {
nsIFrame* f = aItem->GetUnderlyingFrame();
if (mClipAll || nsLayoutUtils::IsProperAncestorFrame(mContainer, f, nsnull))
return new (aBuilder) nsDisplayClip(f, mContainer, aItem, mRect);
return new (aBuilder) nsDisplayClip(aBuilder, f, mContainer, aItem, mRect);
return aItem;
}
protected:
@ -1153,11 +1155,11 @@ public:
nsIFrame* aFrame, nsDisplayList* aList) {
// We are not a stacking context root. There is no valid underlying
// frame for the whole list.
return new (aBuilder) nsDisplayClip(nsnull, mContainer, aList, mRect);
return new (aBuilder) nsDisplayClip(aBuilder, nsnull, mContainer, aList, mRect);
}
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) {
return new (aBuilder) nsDisplayClip(aItem->GetUnderlyingFrame(),
return new (aBuilder) nsDisplayClip(aBuilder, aItem->GetUnderlyingFrame(),
mContainer, aItem, mRect);
}
protected:
@ -1217,14 +1219,14 @@ DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
// REVIEW: From nsContainerFrame::PaintChild
if (nsFrame::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) {
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aFrame, PaintDebugBorder, "DebugBorder",
nsDisplayGeneric(aBuilder, aFrame, PaintDebugBorder, "DebugBorder",
nsDisplayItem::TYPE_DEBUG_BORDER));
}
// Draw a border around the current event target
if (nsFrame::GetShowEventTargetFrameBorder() &&
aFrame->PresContext()->PresShell()->GetDrawEventTargetFrame() == aFrame) {
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aFrame, PaintEventTargetBorder, "EventTargetBorder",
nsDisplayGeneric(aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
nsDisplayItem::TYPE_EVENT_TARGET_BORDER));
}
}
@ -1361,22 +1363,20 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
#ifdef MOZ_SVG
/* If there are any SVG effects, wrap up the list in an effects list. */
if (usingSVGEffects) {
nsDisplaySVGEffects* svgList = new (aBuilder) nsDisplaySVGEffects(this, &resultList);
if (!svgList)
return NS_ERROR_OUT_OF_MEMORY;
/* List now emptied, so add the new list to the top. */
resultList.AppendToTop(svgList);
rv = resultList.AppendNewToTop(
new (aBuilder) nsDisplaySVGEffects(aBuilder, this, &resultList));
if (NS_FAILED(rv))
return rv;
} else
#endif
/* If there is any opacity, wrap it up in an opacity list. */
if (disp->mOpacity < 1.0f) {
nsDisplayOpacity* opacityList = new (aBuilder) nsDisplayOpacity(this, &resultList);
if (!opacityList)
return NS_ERROR_OUT_OF_MEMORY;
resultList.AppendToTop(opacityList);
rv = resultList.AppendNewToTop(
new (aBuilder) nsDisplayOpacity(aBuilder, this, &resultList));
if (NS_FAILED(rv))
return rv;
}
/* If we're going to apply a transformation, wrap everything in an
@ -1384,11 +1384,10 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
*/
if ((mState & NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS) &&
disp->HasTransform()) {
nsDisplayTransform* transform = new (aBuilder) nsDisplayTransform(this, &resultList);
if (!transform)
return NS_ERROR_OUT_OF_MEMORY;
resultList.AppendToTop(transform);
rv = resultList.AppendNewToTop(
new (aBuilder) nsDisplayTransform(aBuilder, this, &resultList));
if (NS_FAILED(rv))
return rv;
}
aList->AppendToTop(&resultList);
@ -1600,11 +1599,11 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// Genuine stacking contexts, and positioned pseudo-stacking-contexts,
// go in this level.
rv = aLists.PositionedDescendants()->AppendNewToTop(new (aBuilder)
nsDisplayWrapList(aChild, &list));
nsDisplayWrapList(aBuilder, aChild, &list));
NS_ENSURE_SUCCESS(rv, rv);
} else if (disp->IsFloating()) {
rv = aLists.Floats()->AppendNewToTop(new (aBuilder)
nsDisplayWrapList(aChild, &list));
nsDisplayWrapList(aBuilder, aChild, &list));
NS_ENSURE_SUCCESS(rv, rv);
} else {
aLists.Content()->AppendToTop(&list);

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

@ -482,13 +482,13 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (NS_SUCCEEDED(rv)) {
if (subdocRootFrame && parentAPD != subdocAPD) {
nsDisplayZoom* zoomItem =
new (aBuilder) nsDisplayZoom(subdocRootFrame, &childItems,
new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems,
subdocAPD, parentAPD);
childItems.AppendToTop(zoomItem);
}
// Clip children to the child root frame's rectangle
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayClip(this, this, &childItems,
new (aBuilder) nsDisplayClip(aBuilder, this, this, &childItems,
subdocBoundsInParentUnits));
}
// delete childItems in case of OOM

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

@ -810,11 +810,8 @@ nsHTMLFramesetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
NS_ENSURE_SUCCESS(rv, rv);
if (mDragger && aBuilder->IsForEventDelivery()) {
// REVIEW: GetFrameForPoint would always target ourselves if mDragger set
nsDisplayItem* item = new (aBuilder) nsDisplayEventReceiver(this);
if (!item)
return NS_ERROR_OUT_OF_MEMORY;
aLists.Content()->AppendToTop(item);
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
}
return rv;
}
@ -1620,8 +1617,9 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
class nsDisplayFramesetBorder : public nsDisplayItem {
public:
nsDisplayFramesetBorder(nsHTMLFramesetBorderFrame* aFrame)
: nsDisplayItem(aFrame) {
nsDisplayFramesetBorder(nsDisplayListBuilder* aBuilder,
nsHTMLFramesetBorderFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayFramesetBorder);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1653,11 +1651,8 @@ nsHTMLFramesetBorderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsDisplayItem* item = new (aBuilder) nsDisplayFramesetBorder(this);
if (!item)
return NS_ERROR_OUT_OF_MEMORY;
aLists.Content()->AppendToTop(item);
return NS_OK;
return aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayFramesetBorder(aBuilder, this));
}
void nsHTMLFramesetBorderFrame::PaintBorder(nsIRenderingContext& aRenderingContext,
@ -1829,7 +1824,9 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
class nsDisplayFramesetBlank : public nsDisplayItem {
public:
nsDisplayFramesetBlank(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayFramesetBlank(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayFramesetBlank);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1864,9 +1861,6 @@ nsHTMLFramesetBlankFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsDisplayItem* item = new (aBuilder) nsDisplayFramesetBlank(this);
if (!item)
return NS_ERROR_OUT_OF_MEMORY;
aLists.Content()->AppendToTop(item);
return NS_OK;
return aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayFramesetBlank(aBuilder, this));
}

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

@ -1712,7 +1712,8 @@ AppendToTop(nsDisplayListBuilder* aBuilder, nsDisplayList* aDest,
nsDisplayList* aSource, nsIFrame* aSourceFrame, PRBool aOwnLayer)
{
if (aOwnLayer) {
aDest->AppendNewToTop(new (aBuilder) nsDisplayOwnLayer(aSourceFrame, aSource));
aDest->AppendNewToTop(
new (aBuilder) nsDisplayOwnLayer(aBuilder, aSourceFrame, aSource));
} else {
aDest->AppendToTop(aSource);
}

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

@ -64,8 +64,8 @@ CanvasElementFromContent(nsIContent *content)
class nsDisplayCanvas : public nsDisplayItem {
public:
nsDisplayCanvas(nsIFrame* aFrame)
: nsDisplayItem(aFrame)
nsDisplayCanvas(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)
{
MOZ_COUNT_CTOR(nsDisplayCanvas);
}
@ -283,7 +283,8 @@ nsHTMLCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
rv = aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplayCanvas(this));
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayCanvas(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
return DisplaySelectionOverlay(aBuilder, aLists,

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

@ -73,9 +73,10 @@
class nsDisplayTextDecoration : public nsDisplayItem {
public:
nsDisplayTextDecoration(nsHTMLContainerFrame* aFrame, PRUint8 aDecoration,
nsDisplayTextDecoration(nsDisplayListBuilder* aBuilder,
nsHTMLContainerFrame* aFrame, PRUint8 aDecoration,
nscolor aColor, nsLineBox* aLine)
: nsDisplayItem(aFrame), mLine(aLine), mColor(aColor),
: nsDisplayItem(aBuilder, aFrame), mLine(aLine), mColor(aColor),
mDecoration(aDecoration) {
MOZ_COUNT_CTOR(nsDisplayTextDecoration);
}
@ -96,9 +97,9 @@ public:
}
private:
nsLineBox* mLine;
nscolor mColor;
PRUint8 mDecoration;
nsLineBox* mLine;
nscolor mColor;
PRUint8 mDecoration;
};
void
@ -157,10 +158,11 @@ nsDisplayTextDecoration::GetBounds(nsDisplayListBuilder* aBuilder)
class nsDisplayTextShadow : public nsDisplayItem {
public:
nsDisplayTextShadow(nsHTMLContainerFrame* aFrame,
nsDisplayTextShadow(nsDisplayListBuilder* aBuilder,
nsHTMLContainerFrame* aFrame,
const PRUint8 aDecoration,
nsLineBox* aLine)
: nsDisplayItem(aFrame), mLine(aLine),
: nsDisplayItem(aBuilder, aFrame), mLine(aLine),
mDecorationFlags(aDecoration) {
MOZ_COUNT_CTOR(nsDisplayTextShadow);
}
@ -353,25 +355,25 @@ nsHTMLContainerFrame::DisplayTextDecorations(nsDisplayListBuilder* aBuilder,
// list, underneath the text and all decorations.
if (GetStyleText()->mTextShadow) {
nsresult rv = aBelowTextDecorations->AppendNewToTop(new (aBuilder)
nsDisplayTextShadow(this, decorations, aLine));
nsDisplayTextShadow(aBuilder, this, decorations, aLine));
NS_ENSURE_SUCCESS(rv, rv);
}
if (decorations & NS_STYLE_TEXT_DECORATION_UNDERLINE) {
nsresult rv = aBelowTextDecorations->AppendNewToTop(new (aBuilder)
nsDisplayTextDecoration(this, NS_STYLE_TEXT_DECORATION_UNDERLINE,
nsDisplayTextDecoration(aBuilder, this, NS_STYLE_TEXT_DECORATION_UNDERLINE,
underColor, aLine));
NS_ENSURE_SUCCESS(rv, rv);
}
if (decorations & NS_STYLE_TEXT_DECORATION_OVERLINE) {
nsresult rv = aBelowTextDecorations->AppendNewToTop(new (aBuilder)
nsDisplayTextDecoration(this, NS_STYLE_TEXT_DECORATION_OVERLINE,
nsDisplayTextDecoration(aBuilder, this, NS_STYLE_TEXT_DECORATION_OVERLINE,
overColor, aLine));
NS_ENSURE_SUCCESS(rv, rv);
}
if (decorations & NS_STYLE_TEXT_DECORATION_LINE_THROUGH) {
nsresult rv = aAboveTextDecorations->AppendNewToTop(new (aBuilder)
nsDisplayTextDecoration(this, NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
nsDisplayTextDecoration(aBuilder, this, NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
strikeColor, aLine));
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -1131,8 +1131,9 @@ static void PaintDebugImageMap(nsIFrame* aFrame, nsIRenderingContext* aCtx,
*/
class nsDisplayImage : public nsDisplayItem {
public:
nsDisplayImage(nsImageFrame* aFrame, imgIContainer* aImage)
: nsDisplayItem(aFrame), mImage(aImage) {
nsDisplayImage(nsDisplayListBuilder* aBuilder, nsImageFrame* aFrame,
imgIContainer* aImage)
: nsDisplayItem(aBuilder, aFrame), mImage(aImage) {
MOZ_COUNT_CTOR(nsDisplayImage);
}
virtual ~nsDisplayImage() {
@ -1234,13 +1235,13 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// No image yet, or image load failed. Draw the alt-text and an icon
// indicating the status
rv = aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, PaintAltFeedback, "AltFeedback",
nsDisplayGeneric(aBuilder, this, PaintAltFeedback, "AltFeedback",
nsDisplayItem::TYPE_ALT_FEEDBACK));
NS_ENSURE_SUCCESS(rv, rv);
}
else {
rv = aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayImage(this, imgCon));
nsDisplayImage(aBuilder, this, imgCon));
NS_ENSURE_SUCCESS(rv, rv);
// If we were previously displaying an icon, we're not anymore
@ -1253,7 +1254,7 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
#ifdef DEBUG
if (GetShowFrameBorders() && GetImageMap(PresContext())) {
rv = aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, PaintDebugImageMap, "DebugImageMap",
nsDisplayGeneric(aBuilder, this, PaintDebugImageMap, "DebugImageMap",
nsDisplayItem::TYPE_DEBUG_IMAGE_MAP));
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -1347,11 +1347,11 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// determine if we are printing
if (type == nsPresContext::eContext_Print)
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, PaintPrintPlugin, "PrintPlugin",
nsDisplayGeneric(aBuilder, this, PaintPrintPlugin, "PrintPlugin",
nsDisplayItem::TYPE_PRINT_PLUGIN));
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayPlugin(this));
nsDisplayPlugin(aBuilder, this));
}
void

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

@ -264,8 +264,8 @@ private:
class nsDisplayPlugin : public nsDisplayItem {
public:
nsDisplayPlugin(nsIFrame* aFrame)
: nsDisplayItem(aFrame)
nsDisplayPlugin(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)
{
MOZ_COUNT_CTOR(nsDisplayPlugin);
}

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

@ -424,19 +424,22 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (PresContext()->IsScreen()) {
rv = set.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintPrintPreviewBackground, "PrintPreviewBackground",
nsDisplayGeneric(aBuilder, this, ::PaintPrintPreviewBackground,
"PrintPreviewBackground",
nsDisplayItem::TYPE_PRINT_PREVIEW_BACKGROUND));
NS_ENSURE_SUCCESS(rv, rv);
}
rv = set.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintPageContent, "PageContent",
nsDisplayGeneric(aBuilder, this, ::PaintPageContent,
"PageContent",
nsDisplayItem::TYPE_PAGE_CONTENT));
NS_ENSURE_SUCCESS(rv, rv);
if (PresContext()->IsRootPaginatedDocument()) {
rv = set.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintHeaderFooter, "HeaderFooter",
nsDisplayGeneric(aBuilder, this, ::PaintHeaderFooter,
"HeaderFooter",
nsDisplayItem::TYPE_HEADER_FOOTER));
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -237,7 +237,7 @@ nsPlaceholderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, PaintDebugPlaceholder, "DebugPlaceholder",
nsDisplayGeneric(aBuilder, this, PaintDebugPlaceholder, "DebugPlaceholder",
nsDisplayItem::TYPE_DEBUG_PLACEHOLDER));
#else // DEBUG
return NS_OK;

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

@ -715,7 +715,7 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
NS_ENSURE_SUCCESS(rv, rv);
rv = aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintPageSequence, "PageSequence",
nsDisplayGeneric(aBuilder, this, ::PaintPageSequence, "PageSequence",
nsDisplayItem::TYPE_PAGE_SEQUENCE));
NS_ENSURE_SUCCESS(rv, rv);

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

@ -3928,7 +3928,8 @@ nsTextFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
class nsDisplayText : public nsDisplayItem {
public:
nsDisplayText(nsTextFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayText(nsDisplayListBuilder* aBuilder, nsTextFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayText);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -3978,7 +3979,8 @@ nsTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
PresContext()->IsDynamic() && !aBuilder->IsForEventDelivery())
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplayText(this));
return aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayText(aBuilder, this));
}
static nsIFrame*

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

@ -356,8 +356,8 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
class nsDisplayVideo : public nsDisplayItem {
public:
nsDisplayVideo(nsVideoFrame* aFrame)
: nsDisplayItem(aFrame)
nsDisplayVideo(nsDisplayListBuilder* aBuilder, nsVideoFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)
{
MOZ_COUNT_CTOR(nsDisplayVideo);
}
@ -423,7 +423,7 @@ nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (HasVideoElement() && !ShouldDisplayPoster()) {
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayVideo(this));
new (aBuilder) nsDisplayVideo(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -1867,8 +1867,9 @@ nsMathMLChar::ComposeChildren(nsPresContext* aPresContext,
class nsDisplayMathMLSelectionRect : public nsDisplayItem {
public:
nsDisplayMathMLSelectionRect(nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aFrame), mRect(aRect) {
nsDisplayMathMLSelectionRect(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aBuilder, aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLSelectionRect);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1897,9 +1898,10 @@ void nsDisplayMathMLSelectionRect::Paint(nsDisplayListBuilder* aBuilder,
class nsDisplayMathMLCharBackground : public nsDisplayItem {
public:
nsDisplayMathMLCharBackground(nsIFrame* aFrame, const nsRect& aRect,
nsStyleContext* aStyleContext)
: nsDisplayItem(aFrame), mStyleContext(aStyleContext), mRect(aRect) {
nsDisplayMathMLCharBackground(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect,
nsStyleContext* aStyleContext)
: nsDisplayItem(aBuilder, aFrame), mStyleContext(aStyleContext), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1929,9 +1931,10 @@ void nsDisplayMathMLCharBackground::Paint(nsDisplayListBuilder* aBuilder,
class nsDisplayMathMLCharForeground : public nsDisplayItem {
public:
nsDisplayMathMLCharForeground(nsIFrame* aFrame, nsMathMLChar* aChar,
PRBool aIsSelected)
: nsDisplayItem(aFrame), mChar(aChar), mIsSelected(aIsSelected) {
nsDisplayMathMLCharForeground(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsMathMLChar* aChar,
PRBool aIsSelected)
: nsDisplayItem(aBuilder, aFrame), mChar(aChar), mIsSelected(aIsSelected) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharForeground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1968,8 +1971,9 @@ private:
#ifdef NS_DEBUG
class nsDisplayMathMLCharDebug : public nsDisplayItem {
public:
nsDisplayMathMLCharDebug(nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aFrame), mRect(aRect) {
nsDisplayMathMLCharDebug(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aBuilder, aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharDebug);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1981,8 +1985,9 @@ public:
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx);
NS_DISPLAY_DECL_NAME("MathMLCharDebug", TYPE_MATHML_CHAR_DEBUG)
private:
nsRect mRect;
nsRect mRect;
};
void nsDisplayMathMLCharDebug::Paint(nsDisplayListBuilder* aBuilder,
@ -2026,7 +2031,7 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
// paint the selection background -- beware MathML frames overlap a lot
if (aSelectedRect && !aSelectedRect->IsEmpty()) {
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLSelectionRect(aForFrame, *aSelectedRect));
nsDisplayMathMLSelectionRect(aBuilder, aForFrame, *aSelectedRect));
NS_ENSURE_SUCCESS(rv, rv);
}
else if (mRect.width && mRect.height) {
@ -2034,7 +2039,7 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
if (styleContext != parentContext &&
NS_GET_A(backg->mBackgroundColor) > 0) {
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLCharBackground(aForFrame, mRect, styleContext));
nsDisplayMathMLCharBackground(aBuilder, aForFrame, mRect, styleContext));
NS_ENSURE_SUCCESS(rv, rv);
}
//else
@ -2043,12 +2048,12 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
// for visual debug
rv = aLists.BorderBackground()->AppendToTop(new (aBuilder)
nsDisplayMathMLCharDebug(aForFrame, mRect));
nsDisplayMathMLCharDebug(aBuilder, aForFrame, mRect));
NS_ENSURE_SUCCESS(rv, rv);
#endif
}
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLCharForeground(aForFrame, this,
nsDisplayMathMLCharForeground(aBuilder, aForFrame, this,
aSelectedRect && !aSelectedRect->IsEmpty()));
}

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

@ -124,8 +124,8 @@ nsMathMLContainerFrame::ReflowError(nsIRenderingContext& aRenderingContext,
class nsDisplayMathMLError : public nsDisplayItem {
public:
nsDisplayMathMLError(nsIFrame* aFrame)
: nsDisplayItem(aFrame) {
nsDisplayMathMLError(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayMathMLError);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -672,7 +672,8 @@ nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!IsVisibleForPainting(aBuilder))
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplayMathMLError(this));
return aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayMathMLError(aBuilder, this));
}
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);

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

@ -454,8 +454,9 @@ nsCSSMapping {
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
class nsDisplayMathMLBoundingMetrics : public nsDisplayItem {
public:
nsDisplayMathMLBoundingMetrics(nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aFrame), mRect(aRect) {
nsDisplayMathMLBoundingMetrics(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aBuilder, aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLBoundingMetrics);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -492,14 +493,15 @@ nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder,
nscoord h = aMetrics.ascent + aMetrics.descent;
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLBoundingMetrics(this, nsRect(x,y,w,h)));
nsDisplayMathMLBoundingMetrics(aBuilder, this, nsRect(x,y,w,h)));
}
#endif
class nsDisplayMathMLBar : public nsDisplayItem {
public:
nsDisplayMathMLBar(nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aFrame), mRect(aRect) {
nsDisplayMathMLBar(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aBuilder, aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLBar);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -531,5 +533,5 @@ nsMathMLFrame::DisplayBar(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLBar(aFrame, aRect));
nsDisplayMathMLBar(aBuilder, aFrame, aRect));
}

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

@ -739,9 +739,10 @@ nsMathMLmencloseFrame::SetAdditionalStyleContext(PRInt32 aIndex,
class nsDisplayNotation : public nsDisplayItem
{
public:
nsDisplayNotation(nsIFrame* aFrame, const nsRect& aRect,
nsDisplayNotation(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect,
nscoord aThickness, nsMencloseNotation aType)
: nsDisplayItem(aFrame), mRect(aRect),
: nsDisplayItem(aBuilder, aFrame), mRect(aRect),
mThickness(aThickness), mType(aType) {
MOZ_COUNT_CTOR(nsDisplayNotation);
}
@ -823,7 +824,5 @@ nsMathMLmencloseFrame::DisplayNotation(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayNotation(aFrame, aRect,
aThickness,
aType));
nsDisplayNotation(aBuilder, aFrame, aRect, aThickness, aType));
}

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

@ -585,9 +585,10 @@ nsMathMLmfracFrame::UpdatePresentationDataFromChildAt(PRInt32 aFirstInde
class nsDisplayMathMLSlash : public nsDisplayItem {
public:
nsDisplayMathMLSlash(nsIFrame* aFrame, const nsRect& aRect,
nsDisplayMathMLSlash(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect,
nscoord aThickness)
: nsDisplayItem(aFrame), mRect(aRect), mThickness(aThickness) {
: nsDisplayItem(aBuilder, aFrame), mRect(aRect), mThickness(aThickness) {
MOZ_COUNT_CTOR(nsDisplayMathMLSlash);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -636,6 +637,5 @@ nsMathMLmfracFrame::DisplaySlash(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLSlash(aFrame, aRect,
aThickness));
nsDisplayMathMLSlash(aBuilder, aFrame, aRect, aThickness));
}

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

@ -420,7 +420,9 @@ nsSVGOuterSVGFrame::DidReflow(nsPresContext* aPresContext,
class nsDisplaySVG : public nsDisplayItem {
public:
nsDisplaySVG(nsSVGOuterSVGFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplaySVG(nsDisplayListBuilder* aBuilder,
nsSVGOuterSVGFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplaySVG);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -534,7 +536,8 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
return aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplaySVG(this));
return aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplaySVG(aBuilder, this));
}
void

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

@ -385,7 +385,9 @@ nsTableCellFrame::PaintCellBackground(nsIRenderingContext& aRenderingContext,
class nsDisplayTableCellBackground : public nsDisplayTableItem {
public:
nsDisplayTableCellBackground(nsTableCellFrame* aFrame) : nsDisplayTableItem(aFrame) {
nsDisplayTableCellBackground(nsDisplayListBuilder* aBuilder,
nsTableCellFrame* aFrame) :
nsDisplayTableItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableCellBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -458,8 +460,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// display outset box-shadows if we need to.
PRBool hasBoxShadow = !!(GetStyleBorder()->mBoxShadow);
if (hasBoxShadow) {
nsDisplayItem* item = new (aBuilder) nsDisplayBoxShadowOuter(this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -470,7 +472,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// The cell background was not painted by the nsTablePainter,
// so we need to do it. We have special background processing here
// so we need to duplicate some code from nsFrame::DisplayBorderBackgroundOutline
nsDisplayTableItem* item = new (aBuilder) nsDisplayTableCellBackground(this);
nsDisplayTableItem* item =
new (aBuilder) nsDisplayTableCellBackground(aBuilder, this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
NS_ENSURE_SUCCESS(rv, rv);
item->UpdateForFrameBackground(this);
@ -478,8 +481,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// display inset box-shadows if we need to.
if (hasBoxShadow) {
nsDisplayItem* item = new (aBuilder) nsDisplayBoxShadowInner(this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -487,7 +490,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!tableFrame->IsBorderCollapse() && HasBorder() &&
emptyCellStyle == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBorder(this));
nsDisplayBorder(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -496,7 +499,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
(GetStateBits() & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT;
if (isSelected) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintTableCellSelection, "TableCellSelection",
nsDisplayGeneric(aBuilder, this, ::PaintTableCellSelection,
"TableCellSelection",
nsDisplayItem::TYPE_TABLE_CELL_SELECTION));
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -1121,7 +1121,9 @@ nsDisplayTableItem::UpdateForFrameBackground(nsIFrame* aFrame)
class nsDisplayTableBorderBackground : public nsDisplayTableItem {
public:
nsDisplayTableBorderBackground(nsTableFrame* aFrame) : nsDisplayTableItem(aFrame) {
nsDisplayTableBorderBackground(nsDisplayListBuilder* aBuilder,
nsTableFrame* aFrame) :
nsDisplayTableItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableBorderBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1215,8 +1217,8 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
// Paint the outset box-shadows for the table frames
PRBool hasBoxShadow = aFrame->GetStyleBorder()->mBoxShadow != nsnull;
if (hasBoxShadow) {
nsDisplayItem* item = new (aBuilder) nsDisplayBoxShadowOuter(aFrame);
nsresult rv = lists->BorderBackground()->AppendNewToTop(item);
nsresult rv = lists->BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, aFrame));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1224,15 +1226,15 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
// handling events.
// XXX how to handle collapsed borders?
if (aBuilder->IsForEventDelivery()) {
nsresult rv = lists->BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBackground(aFrame));
nsresult rv = lists->BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBackground(aBuilder, aFrame));
NS_ENSURE_SUCCESS(rv, rv);
}
// Paint the inset box-shadows for the table frames
if (hasBoxShadow) {
nsDisplayItem* item = new (aBuilder) nsDisplayBoxShadowInner(aFrame);
nsresult rv = lists->BorderBackground()->AppendNewToTop(item);
nsresult rv = lists->BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, aFrame));
NS_ENSURE_SUCCESS(rv, rv);
}
}
@ -1320,7 +1322,7 @@ nsTableFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (aBuilder->IsForEventDelivery() ||
AnyTablePartHasBorderOrBackground(this, GetNextSibling()) ||
AnyTablePartHasBorderOrBackground(mColGroups.FirstChild(), nsnull)) {
item = new (aBuilder) nsDisplayTableBorderBackground(this);
item = new (aBuilder) nsDisplayTableBorderBackground(aBuilder, this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -76,7 +76,8 @@ static inline PRBool IS_TABLE_CELL(nsIAtom* frameType) {
class nsDisplayTableItem : public nsDisplayItem
{
public:
nsDisplayTableItem(nsIFrame* aFrame) : nsDisplayItem(aFrame),
nsDisplayTableItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame),
mPartHasFixedBackground(PR_FALSE) {}
virtual PRBool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,

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

@ -577,7 +577,9 @@ nsTableRowFrame::CalcHeight(const nsHTMLReflowState& aReflowState)
*/
class nsDisplayTableRowBackground : public nsDisplayTableItem {
public:
nsDisplayTableRowBackground(nsTableRowFrame* aFrame) : nsDisplayTableItem(aFrame) {
nsDisplayTableRowBackground(nsDisplayListBuilder* aBuilder,
nsTableRowFrame* aFrame) :
nsDisplayTableItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableRowBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -622,7 +624,7 @@ nsTableRowFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// We would use nsDisplayGeneric for this rare case except that we
// need the background to be larger than the row frame in some
// cases.
item = new (aBuilder) nsDisplayTableRowBackground(this);
item = new (aBuilder) nsDisplayTableRowBackground(aBuilder, this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -166,7 +166,9 @@ nsTableRowGroupFrame::InitRepeatedFrame(nsPresContext* aPresContext,
*/
class nsDisplayTableRowGroupBackground : public nsDisplayTableItem {
public:
nsDisplayTableRowGroupBackground(nsTableRowGroupFrame* aFrame) : nsDisplayTableItem(aFrame) {
nsDisplayTableRowGroupBackground(nsDisplayListBuilder* aBuilder,
nsTableRowGroupFrame* aFrame) :
nsDisplayTableItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableRowGroupBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -261,7 +263,7 @@ nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// This background is created regardless of whether this frame is
// visible or not. Visibility decisions are delegated to the
// table background painter.
item = new (aBuilder) nsDisplayTableRowGroupBackground(this);
item = new (aBuilder) nsDisplayTableRowGroupBackground(aBuilder, this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -1264,7 +1264,8 @@ nsBoxFrame::GetDebugPref(nsPresContext* aPresContext)
class nsDisplayXULDebug : public nsDisplayItem {
public:
nsDisplayXULDebug(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayXULDebug(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULDebug);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1313,10 +1314,11 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// REVIEW: From GetFrameForPoint
if (mState & NS_STATE_CURRENTLY_IN_DEBUG) {
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, PaintXULDebugBackground, "XULDebugBackground"));
nsDisplayGeneric(aBuilder, this, PaintXULDebugBackground,
"XULDebugBackground"));
NS_ENSURE_SUCCESS(rv, rv);
rv = aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayXULDebug(this));
nsDisplayXULDebug(Builder this));
NS_ENSURE_SUCCESS(rv, rv);
}
#endif
@ -2140,12 +2142,14 @@ nsBoxFrame::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild)
// reasonable thing to do.
class nsDisplayXULEventRedirector : public nsDisplayWrapList {
public:
nsDisplayXULEventRedirector(nsIFrame* aFrame, nsDisplayItem* aItem,
nsDisplayXULEventRedirector(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayItem* aItem,
nsIFrame* aTargetFrame)
: nsDisplayWrapList(aFrame, aItem), mTargetFrame(aTargetFrame) {}
nsDisplayXULEventRedirector(nsIFrame* aFrame, nsDisplayList* aList,
: nsDisplayWrapList(aBuilder, aFrame, aItem), mTargetFrame(aTargetFrame) {}
nsDisplayXULEventRedirector(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList,
nsIFrame* aTargetFrame)
: nsDisplayWrapList(aFrame, aList), mTargetFrame(aTargetFrame) {}
: nsDisplayWrapList(aBuilder, aFrame, aList), mTargetFrame(aTargetFrame) {}
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames);
NS_DISPLAY_DECL_NAME("XULEventRedirector", TYPE_XUL_EVENT_REDIRECTOR)
@ -2197,12 +2201,12 @@ public:
virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList) {
return new (aBuilder)
nsDisplayXULEventRedirector(aFrame, aList, mTargetFrame);
nsDisplayXULEventRedirector(aBuilder, aFrame, aList, mTargetFrame);
}
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) {
return new (aBuilder)
nsDisplayXULEventRedirector(aItem->GetUnderlyingFrame(), aItem,
nsDisplayXULEventRedirector(aBuilder, aItem->GetUnderlyingFrame(), aItem,
mTargetFrame);
}
private:

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

@ -107,7 +107,9 @@ NS_IMPL_FRAMEARENA_HELPERS(nsGroupBoxFrame)
class nsDisplayXULGroupBackground : public nsDisplayItem {
public:
nsDisplayXULGroupBackground(nsGroupBoxFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayXULGroupBackground(nsDisplayListBuilder* aBuilder,
nsGroupBoxFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULGroupBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -142,7 +144,7 @@ nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Paint our background and border
if (IsVisibleForPainting(aBuilder)) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayXULGroupBackground(this));
nsDisplayXULGroupBackground(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
rv = DisplayOutline(aBuilder, aLists);

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

@ -311,7 +311,9 @@ nsImageBoxFrame::UpdateLoadFlags()
class nsDisplayXULImage : public nsDisplayItem {
public:
nsDisplayXULImage(nsImageBoxFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayXULImage(nsDisplayListBuilder* aBuilder,
nsImageBoxFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULImage);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -355,7 +357,8 @@ nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!IsVisibleForPainting(aBuilder))
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplayXULImage(this));
return aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayXULImage(aBuilder, this));
}
void

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

@ -167,7 +167,7 @@ nsLeafBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayEventReceiver(this));
nsDisplayEventReceiver(aBuilder, this));
}
/* virtual */ nscoord

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

@ -328,7 +328,7 @@ nsSliderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// This is EVIL, we shouldn't be messing with event delivery just to get
// thumb mouse drag events to arrive at the slider!
return aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayEventReceiver(this));
nsDisplayEventReceiver(aBuilder, this));
}
return nsBoxFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);

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

@ -423,7 +423,7 @@ nsSplitterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
{
// XXX It's probably better not to check visibility here, right?
return aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayEventReceiver(this));
nsDisplayEventReceiver(aBuilder, this));
}
return NS_OK;

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

@ -331,12 +331,14 @@ nsTextBoxFrame::UpdateAttributes(nsIAtom* aAttribute,
class nsDisplayXULTextBox : public nsDisplayItem {
public:
nsDisplayXULTextBox(nsTextBoxFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULTextBox);
nsDisplayXULTextBox(nsDisplayListBuilder* aBuilder,
nsTextBoxFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULTextBox);
}
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayXULTextBox() {
MOZ_COUNT_DTOR(nsDisplayXULTextBox);
MOZ_COUNT_DTOR(nsDisplayXULTextBox);
}
#endif
@ -371,7 +373,7 @@ nsTextBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
NS_ENSURE_SUCCESS(rv, rv);
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayXULTextBox(this));
nsDisplayXULTextBox(aBuilder, this));
}
void

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

@ -2805,7 +2805,7 @@ nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return NS_OK;
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintTreeBody, "XULTreeBody",
nsDisplayGeneric(aBuilder, this, ::PaintTreeBody, "XULTreeBody",
nsDisplayItem::TYPE_XUL_TREE_BODY));
}

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

@ -90,7 +90,9 @@ nsTreeColFrame::DestroyFrom(nsIFrame* aDestructRoot)
class nsDisplayXULTreeColSplitterTarget : public nsDisplayItem {
public:
nsDisplayXULTreeColSplitterTarget(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
nsDisplayXULTreeColSplitterTarget(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame) :
nsDisplayItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULTreeColSplitterTarget);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -158,7 +160,7 @@ nsTreeColFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
NS_ENSURE_SUCCESS(rv, rv);
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayXULTreeColSplitterTarget(this));
nsDisplayXULTreeColSplitterTarget(aBuilder, this));
}
NS_IMETHODIMP