Bug 330300. Move mFrame from nsDisplayItem subclasses up to nsDisplayItem itself, and make GetUnderlyingFrame an inline non-virtual function. Patch by Alfred Peng, r+sr=roc

This commit is contained in:
roc+%cs.cmu.edu 2006-03-14 20:43:18 +00:00
Родитель 7caf3a2f1a
Коммит 6fd863f2dd
26 изменённых файлов: 119 добавлений и 182 удалений

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

@ -459,12 +459,12 @@ nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder,
}
nsDisplayWrapList::nsDisplayWrapList(nsIFrame* aFrame, nsDisplayList* aList)
: mFrame(aFrame) {
: nsDisplayItem(aFrame) {
mList.AppendToTop(aList);
}
nsDisplayWrapList::nsDisplayWrapList(nsIFrame* aFrame, nsDisplayItem* aItem)
: mFrame(aFrame) {
: nsDisplayItem(aFrame) {
mList.AppendToTop(aItem);
}

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

@ -242,7 +242,7 @@ class nsDisplayItemLink {
// This is never instantiated directly, so no need to count constructors and
// destructors.
protected:
nsDisplayItemLink() {}
nsDisplayItemLink() : mAbove(nsnull) {}
nsDisplayItem* mAbove;
friend class nsDisplayList;
@ -267,6 +267,7 @@ class nsDisplayItem : public nsDisplayItemLink {
public:
// This is never instantiated directly (it has pure virtual methods), so no
// need to count constructors and destructors.
nsDisplayItem(nsIFrame* aFrame) : mFrame(aFrame) {}
virtual ~nsDisplayItem() {}
void* operator new(size_t aSize,
@ -306,7 +307,7 @@ public:
* that wrap item lists, this could return nsnull because there is no single
* underlying frame; for leaf items it will never return nsnull.
*/
virtual nsIFrame* GetUnderlyingFrame() = 0;
inline nsIFrame* GetUnderlyingFrame() { return mFrame; }
/**
* The default bounds is the frame border rect.
* @return a rectangle relative to aBuilder->ReferenceFrame() that
@ -389,6 +390,8 @@ protected:
static PRBool ComputeVisibilityFromBounds(nsIFrame* aFrame,
const nsRect& aRect, nsRegion& aCovered, PRBool aIsOpaque);
nsIFrame* mFrame;
};
/**
@ -715,7 +718,7 @@ public:
const nsRect& aDirtyRect, nsPoint aFramePt);
nsDisplayGeneric(nsIFrame* aFrame, PaintCallback aPaint, const char* aName)
: mFrame(aFrame), mPaint(aPaint)
: nsDisplayItem(aFrame), mPaint(aPaint)
#ifdef DEBUG
, mName(aName)
#endif
@ -728,14 +731,12 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect) {
mPaint(mFrame, aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
}
NS_DISPLAY_DECL_NAME(mName)
protected:
nsIFrame* mFrame;
PaintCallback mPaint;
#ifdef DEBUG
const char* mName;
@ -748,7 +749,7 @@ protected:
MOZ_DECL_CTOR_COUNTER(nsDisplayBorder)
class nsDisplayBorder : public nsDisplayItem {
public:
nsDisplayBorder(nsIFrame* aFrame) : mFrame(aFrame) {
nsDisplayBorder(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayBorder);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -757,12 +758,9 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Border")
private:
nsIFrame* mFrame;
};
/**
@ -771,7 +769,7 @@ private:
MOZ_DECL_CTOR_COUNTER(nsDisplayBackground)
class nsDisplayBackground : public nsDisplayItem {
public:
nsDisplayBackground(nsIFrame* aFrame) : mFrame(aFrame) {
nsDisplayBackground(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -781,7 +779,6 @@ public:
#endif
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; }
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual PRBool IsOpaque(nsDisplayListBuilder* aBuilder);
virtual PRBool IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aAncestorFrame);
@ -789,8 +786,6 @@ public:
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Background")
private:
nsIFrame* mFrame;
};
/**
@ -799,7 +794,7 @@ private:
MOZ_DECL_CTOR_COUNTER(nsDisplayOutline)
class nsDisplayOutline : public nsDisplayItem {
public:
nsDisplayOutline(nsIFrame* aFrame) : mFrame(aFrame) {
nsDisplayOutline(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayOutline);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -809,13 +804,10 @@ public:
#endif
virtual Type GetType() { return TYPE_OUTLINE; }
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Outline")
private:
nsIFrame* mFrame;
};
/**
@ -824,7 +816,7 @@ private:
MOZ_DECL_CTOR_COUNTER(nsDisplayEventReceiver)
class nsDisplayEventReceiver : public nsDisplayItem {
public:
nsDisplayEventReceiver(nsIFrame* aFrame) : mFrame(aFrame) {
nsDisplayEventReceiver(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayEventReceiver);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -834,10 +826,7 @@ public:
#endif
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; }
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
NS_DISPLAY_DECL_NAME("EventReceiver")
private:
nsIFrame* mFrame;
};
/**
@ -867,7 +856,6 @@ public:
virtual ~nsDisplayWrapList();
virtual Type GetType() { return TYPE_WRAPLIST; }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt);
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
virtual PRBool IsOpaque(nsDisplayListBuilder* aBuilder);
virtual PRBool IsUniform(nsDisplayListBuilder* aBuilder);
@ -901,7 +889,6 @@ protected:
nsDisplayWrapList() {}
nsDisplayList mList;
nsIFrame* mFrame;
};
/**

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

@ -643,7 +643,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplaySolidColor)
class nsDisplaySolidColor : public nsDisplayItem {
public:
nsDisplaySolidColor(nsIFrame* aFrame, nscolor aColor)
: mFrame(aFrame), mColor(aColor) {
: nsDisplayItem(aFrame), mColor(aColor) {
MOZ_COUNT_CTOR(nsDisplaySolidColor);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -652,12 +652,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("SolidColor")
private:
nsIFrame* mFrame;
nscolor mColor;
};

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

@ -97,7 +97,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayButtonBorderBackground)
class nsDisplayButtonBorderBackground : public nsDisplayItem {
public:
nsDisplayButtonBorderBackground(nsButtonFrameRenderer* aRenderer)
: mBFR(aRenderer) {
: nsDisplayItem(aRenderer->GetFrame()), mBFR(aRenderer) {
MOZ_COUNT_CTOR(nsDisplayButtonBorderBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -106,9 +106,8 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mBFR->GetFrame(); }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) {
return mBFR->GetFrame();
return mFrame;
}
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
@ -121,7 +120,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayButtonForeground)
class nsDisplayButtonForeground : public nsDisplayItem {
public:
nsDisplayButtonForeground(nsButtonFrameRenderer* aRenderer)
: mBFR(aRenderer) {
: nsDisplayItem(aRenderer->GetFrame()), mBFR(aRenderer) {
MOZ_COUNT_CTOR(nsDisplayButtonForeground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -130,7 +129,6 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mBFR->GetFrame(); }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("ButtonForeground")
@ -142,10 +140,9 @@ void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx,
const nsRect& aDirtyRect)
{
nsIFrame* f = mBFR->GetFrame();
NS_ASSERTION(f, "No frame?");
nsPresContext* pc = f->GetPresContext();
nsRect r = nsRect(aBuilder->ToReferenceFrame(f), f->GetSize());
NS_ASSERTION(mFrame, "No frame?");
nsPresContext* pc = mFrame->GetPresContext();
nsRect r = nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize());
// draw the border and background inside the focus and outline borders
mBFR->PaintBorderAndBackground(pc, *aCtx, aDirtyRect, r);
@ -155,10 +152,9 @@ void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx,
const nsRect& aDirtyRect)
{
nsIFrame* f = mBFR->GetFrame();
NS_ASSERTION(f, "No frame?");
nsPresContext* pc = f->GetPresContext();
nsRect r = nsRect(aBuilder->ToReferenceFrame(f), f->GetSize());
NS_ASSERTION(mFrame, "No frame?");
nsPresContext* pc = mFrame->GetPresContext();
nsRect r = nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize());
// draw the focus and outline borders
mBFR->PaintOutlineAndFocusBorders(pc, *aCtx, aDirtyRect, r);

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

@ -69,7 +69,6 @@
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIComponentManager.h"
#include "nsContentUtils.h"
#include "nsITextContent.h"
#include "nsTextFragment.h"
#include "nsCSSFrameConstructor.h"
@ -406,6 +405,20 @@ NS_IMETHODIMP nsComboboxControlFrame::GetAccessible(nsIAccessible** aAccessible)
}
#endif
NS_IMETHODIMP
nsComboboxControlFrame::Init(nsPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
mEventQueueService = do_GetService(kEventQueueServiceCID);
return nsAreaFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
}
void
nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
{
@ -1588,13 +1601,12 @@ nsComboboxControlFrame::RedisplayText(PRInt32 aIndex)
// Send reflow command because the new text maybe larger
nsresult rv = NS_OK;
if (mDisplayContent) {
if (mDisplayContent && mEventQueueService) {
// Don't call ActuallyDisplayText(PR_TRUE) directly here since that
// could cause recursive frame construction. See bug 283117 and the comment in
// HandleRedisplayTextEvent() below.
nsCOMPtr<nsIEventQueue> eventQueue;
rv = nsContentUtils::EventQueueService()->
GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
rv = mEventQueueService->GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
getter_AddRefs(eventQueue));
if (eventQueue) {
RedisplayTextEvent* event = new RedisplayTextEvent(this);
@ -1942,12 +1954,13 @@ NS_IMETHODIMP
nsComboboxControlFrame::Destroy(nsPresContext* aPresContext)
{
// Revoke queued RedisplayTextEvents
nsCOMPtr<nsIEventQueue> eventQueue;
nsContentUtils::EventQueueService()->
GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
getter_AddRefs(eventQueue));
if (eventQueue) {
eventQueue->RevokeEvents(this);
if (mEventQueueService) {
nsCOMPtr<nsIEventQueue> eventQueue;
mEventQueueService->GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
getter_AddRefs(eventQueue));
if (eventQueue) {
eventQueue->RevokeEvents(this);
}
}
nsFormControlFrame::RegUnRegAccessKey(GetPresContext(), NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
@ -2059,7 +2072,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayComboboxFocus)
class nsDisplayComboboxFocus : public nsDisplayItem {
public:
nsDisplayComboboxFocus(nsComboboxControlFrame* aFrame)
: mFrame(aFrame) {
: nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayComboboxFocus);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -2068,18 +2081,16 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("ComboboxFocus")
private:
nsComboboxControlFrame* mFrame;
};
void nsDisplayComboboxFocus::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintFocus(*aCtx, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsComboboxControlFrame*, mFrame)->
PaintFocus(*aCtx, aBuilder->ToReferenceFrame(mFrame));
}
NS_IMETHODIMP

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

@ -167,7 +167,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayFieldSetBorderBackground)
class nsDisplayFieldSetBorderBackground : public nsDisplayItem {
public:
nsDisplayFieldSetBorderBackground(nsFieldSetFrame* aFrame)
: mFrame(aFrame) {
: nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayFieldSetBorderBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -176,13 +176,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt);
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("FieldSetBorderBackground")
private:
nsFieldSetFrame* mFrame;
};
nsIFrame* nsDisplayFieldSetBorderBackground::HitTest(nsDisplayListBuilder* aBuilder,
@ -198,8 +195,8 @@ void
nsDisplayFieldSetBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame),
aDirtyRect);
NS_STATIC_CAST(nsFieldSetFrame*, mFrame)->
PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame), aDirtyRect);
}
NS_IMETHODIMP

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

@ -171,7 +171,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayCheckMark)
class nsDisplayCheckMark : public nsDisplayItem {
public:
nsDisplayCheckMark(nsGfxCheckboxControlFrame* aFrame)
: mFrame(aFrame) {
: nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayCheckMark);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -180,19 +180,16 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("CheckMark")
private:
nsGfxCheckboxControlFrame* mFrame;
};
void
nsDisplayCheckMark::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
mFrame->PaintCheckBox(*aCtx, aBuilder->ToReferenceFrame(mFrame),
aDirtyRect);
NS_STATIC_CAST(nsGfxCheckboxControlFrame*, mFrame)->
PaintCheckBox(*aCtx, aBuilder->ToReferenceFrame(mFrame), aDirtyRect);
}

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

@ -178,7 +178,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayRadioButtonFromStyle)
class nsDisplayRadioButtonFromStyle : public nsDisplayItem {
public:
nsDisplayRadioButtonFromStyle(nsGfxRadioControlFrame* aFrame)
: mFrame(aFrame) {
: nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayRadioButtonFromStyle);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -187,19 +187,16 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("RadioButton")
private:
nsGfxRadioControlFrame* mFrame;
};
void
nsDisplayRadioButtonFromStyle::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
mFrame->PaintRadioButtonFromStyle(*aCtx, aBuilder->ToReferenceFrame(mFrame),
aDirtyRect);
NS_STATIC_CAST(nsGfxRadioControlFrame*, mFrame)->
PaintRadioButtonFromStyle(*aCtx, aBuilder->ToReferenceFrame(mFrame), aDirtyRect);
}
//--------------------------------------------------------------

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

@ -177,7 +177,7 @@ nsBulletFrame::DidSetStyleContext()
MOZ_DECL_CTOR_COUNTER(nsDisplayBullet)
class nsDisplayBullet : public nsDisplayItem {
public:
nsDisplayBullet(nsBulletFrame* aFrame) : mFrame(aFrame) {
nsDisplayBullet(nsBulletFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayBullet);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -186,18 +186,16 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Bullet")
private:
nsBulletFrame* mFrame;
};
void nsDisplayBullet::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintBullet(*aCtx, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsBulletFrame*, mFrame)->
PaintBullet(*aCtx, aBuilder->ToReferenceFrame(mFrame));
}
NS_IMETHODIMP

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

@ -766,7 +766,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplaySelectionOverlay)
class nsDisplaySelectionOverlay : public nsDisplayItem {
public:
nsDisplaySelectionOverlay(nsFrame* aFrame, PRInt16 aSelectionValue)
: mFrame(aFrame), mSelectionValue(aSelectionValue) {
: nsDisplayItem(aFrame), mSelectionValue(aSelectionValue) {
MOZ_COUNT_CTOR(nsDisplaySelectionOverlay);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -775,12 +775,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("SelectionOverlay")
private:
nsFrame* mFrame;
PRInt16 mSelectionValue;
};

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

@ -1621,7 +1621,8 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
MOZ_DECL_CTOR_COUNTER(nsDisplayFramesetBorder)
class nsDisplayFramesetBorder : public nsDisplayItem {
public:
nsDisplayFramesetBorder(nsHTMLFramesetBorderFrame* aFrame) : mFrame(aFrame) {
nsDisplayFramesetBorder(nsHTMLFramesetBorderFrame* aFrame)
: nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayFramesetBorder);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1630,21 +1631,19 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
// REVIEW: see old GetFrameForPoint
// Receives events in its bounds
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("FramesetBorder")
private:
nsHTMLFramesetBorderFrame* mFrame;
};
void nsDisplayFramesetBorder::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintBorder(*aCtx, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsHTMLFramesetBorderFrame*, mFrame)->
PaintBorder(*aCtx, aBuilder->ToReferenceFrame(mFrame));
}
NS_IMETHODIMP
@ -1824,7 +1823,7 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
MOZ_DECL_CTOR_COUNTER(nsDisplayFramesetBlank)
class nsDisplayFramesetBlank : public nsDisplayItem {
public:
nsDisplayFramesetBlank(nsIFrame* aFrame) : mFrame(aFrame) {
nsDisplayFramesetBlank(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayFramesetBlank);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1833,14 +1832,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("FramesetBlank")
private:
nsIFrame* mFrame;
};
void nsDisplayFramesetBlank::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{

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

@ -71,7 +71,8 @@ class nsDisplayTextDecoration : public nsDisplayItem {
public:
nsDisplayTextDecoration(nsHTMLContainerFrame* aFrame, PRUint8 aDecoration,
nscolor aColor, nsLineBox* aLine)
: mFrame(aFrame), mLine(aLine), mColor(aColor), mDecoration(aDecoration) {
: nsDisplayItem(aFrame), mLine(aLine), mColor(aColor),
mDecoration(aDecoration) {
MOZ_COUNT_CTOR(nsDisplayTextDecoration);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -80,12 +81,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("TextDecoration")
private:
nsHTMLContainerFrame* mFrame;
nsLineBox* mLine;
nscolor mColor;
PRUint8 mDecoration;
@ -103,7 +102,7 @@ nsDisplayTextDecoration::Paint(nsDisplayListBuilder* aBuilder,
nsCOMPtr<nsIDeviceContext> deviceContext;
aCtx->GetDeviceContext(*getter_AddRefs(deviceContext));
nsCOMPtr<nsIFontMetrics> normalFont;
const nsStyleVisibility* visibility = mFrame->GetStyleVisibility();
const nsStyleVisibility* visibility = mFrame->GetStyleVisibility();
nsCOMPtr<nsIFontMetrics> fm;
deviceContext->GetMetricsFor(font->mFont, visibility->mLangGroup,
*getter_AddRefs(fm));
@ -112,17 +111,18 @@ nsDisplayTextDecoration::Paint(nsDisplayListBuilder* aBuilder,
// REVIEW: From nsHTMLContainerFrame::PaintTextDecorations
nscoord ascent, offset, size;
nsHTMLContainerFrame* f = NS_STATIC_CAST(nsHTMLContainerFrame*, mFrame);
fm->GetMaxAscent(ascent);
if (mDecoration != NS_STYLE_TEXT_DECORATION_LINE_THROUGH) {
fm->GetUnderline(offset, size);
if (mDecoration == NS_STYLE_TEXT_DECORATION_UNDERLINE) {
mFrame->PaintTextDecorationLine(*aCtx, pt, mLine, mColor, offset, ascent, size);
f->PaintTextDecorationLine(*aCtx, pt, mLine, mColor, offset, ascent, size);
} else if (mDecoration == NS_STYLE_TEXT_DECORATION_OVERLINE) {
mFrame->PaintTextDecorationLine(*aCtx, pt, mLine, mColor, ascent, ascent, size);
f->PaintTextDecorationLine(*aCtx, pt, mLine, mColor, ascent, ascent, size);
}
} else {
fm->GetStrikeout(offset, size);
mFrame->PaintTextDecorationLine(*aCtx, pt, mLine, mColor, offset, ascent, size);
f->PaintTextDecorationLine(*aCtx, pt, mLine, mColor, offset, ascent, size);
}
}

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

@ -1263,26 +1263,24 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayImage)
class nsDisplayImage : public nsDisplayItem {
public:
nsDisplayImage(nsImageFrame* aFrame, imgIContainer* aImage)
: mFrame(aFrame), mImage(aImage) {
: nsDisplayItem(aFrame), mImage(aImage) {
MOZ_COUNT_CTOR(nsDisplayImage);
}
virtual ~nsDisplayImage() {
MOZ_COUNT_DTOR(nsDisplayImage);
}
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Image")
private:
nsImageFrame* mFrame;
nsCOMPtr<imgIContainer> mImage;
};
void
nsDisplayImage::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
mFrame->PaintImage(*aCtx, aBuilder->ToReferenceFrame(mFrame), aDirtyRect,
mImage);
NS_STATIC_CAST(nsImageFrame*, mFrame)->
PaintImage(*aCtx, aBuilder->ToReferenceFrame(mFrame), aDirtyRect, mImage);
}
void

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

@ -1957,7 +1957,7 @@ nsTextFrame::CharacterDataChanged(nsPresContext* aPresContext,
MOZ_DECL_CTOR_COUNTER(nsDisplayText)
class nsDisplayText : public nsDisplayItem {
public:
nsDisplayText(nsTextFrame* aFrame) : mFrame(aFrame) {
nsDisplayText(nsTextFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayText);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1966,19 +1966,17 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Text")
private:
nsTextFrame* mFrame;
};
void
nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
mFrame->PaintText(*aCtx, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsTextFrame*, mFrame)->
PaintText(*aCtx, aBuilder->ToReferenceFrame(mFrame));
}
NS_IMETHODIMP

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

@ -1927,7 +1927,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLSelectionRect)
class nsDisplayMathMLSelectionRect : public nsDisplayItem {
public:
nsDisplayMathMLSelectionRect(nsIFrame* aFrame, const nsRect& aRect)
: mFrame(aFrame), mRect(aRect) {
: nsDisplayItem(aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLSelectionRect);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1936,12 +1936,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("MathMLSelectionRect")
private:
nsIFrame* mFrame;
nsRect mRect;
};
@ -1961,7 +1959,7 @@ class nsDisplayMathMLCharBackground : public nsDisplayItem {
public:
nsDisplayMathMLCharBackground(nsIFrame* aFrame, const nsRect& aRect,
nsStyleContext* aStyleContext)
: mFrame(aFrame), mStyleContext(aStyleContext), mRect(aRect) {
: nsDisplayItem(aFrame), mStyleContext(aStyleContext), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1970,12 +1968,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("MathMLCharBackground")
private:
nsIFrame* mFrame;
nsStyleContext* mStyleContext;
nsRect mRect;
};
@ -1998,7 +1994,7 @@ class nsDisplayMathMLCharForeground : public nsDisplayItem {
public:
nsDisplayMathMLCharForeground(nsIFrame* aFrame, nsMathMLChar* aChar,
PRBool aIsSelected)
: mFrame(aFrame), mChar(aChar), mIsSelected(aIsSelected) {
: nsDisplayItem(aFrame), mChar(aChar), mIsSelected(aIsSelected) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharForeground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -2007,12 +2003,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("MathMLCharForeground")
private:
nsIFrame* mFrame;
nsMathMLChar* mChar;
PRPackedBool mIsSelected;
};
@ -2029,7 +2023,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLCharDebug)
class nsDisplayMathMLCharDebug : public nsDisplayItem {
public:
nsDisplayMathMLCharDebug(nsIFrame* aFrame, const nsRect& aRect)
: mFrame(aFrame), mRect(aRect) {
: nsDisplayItem(aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharDebug);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -2038,12 +2032,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("MathMLCharDebug")
private:
nsIFrame* mFrame;
nsRect mRect;
};

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

@ -130,7 +130,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLError)
class nsDisplayMathMLError : public nsDisplayItem {
public:
nsDisplayMathMLError(nsIFrame* aFrame)
: mFrame(aFrame) {
: nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayMathMLError);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -139,12 +139,9 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("MathMLError")
private:
nsIFrame* mFrame;
};
void nsDisplayMathMLError::Paint(nsDisplayListBuilder* aBuilder,

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

@ -732,7 +732,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLBoundingMetrics)
class nsDisplayMathMLBoundingMetrics : public nsDisplayItem {
public:
nsDisplayMathMLBoundingMetrics(nsIFrame* aFrame, const nsRect& aRect)
: mFrame(aFrame), mRect(aRect) {
: nsDisplayItem(aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLBoundingMetrics);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -741,12 +741,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("MathMLBoundingMetrics")
private:
nsIFrame* mFrame;
nsRect mRect;
};
@ -779,7 +777,7 @@ MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLBar)
class nsDisplayMathMLBar : public nsDisplayItem {
public:
nsDisplayMathMLBar(nsIFrame* aFrame, const nsRect& aRect)
: mFrame(aFrame), mRect(aRect) {
: nsDisplayItem(aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLBar);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -788,12 +786,10 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("MathMLBar")
private:
nsIFrame* mFrame;
nsRect mRect;
};

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

@ -602,7 +602,7 @@ nsSVGOuterSVGFrame::RemoveFrame(nsIAtom* aListName,
MOZ_DECL_CTOR_COUNTER(nsDisplaySVG)
class nsDisplaySVG : public nsDisplayItem {
public:
nsDisplaySVG(nsSVGOuterSVGFrame* aFrame) : mFrame(aFrame) {
nsDisplaySVG(nsSVGOuterSVGFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplaySVG);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -612,25 +612,24 @@ public:
#endif
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt);
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("SVGEventReceiver")
private:
nsSVGOuterSVGFrame* mFrame;
};
nsIFrame*
nsDisplaySVG::HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt)
{
return mFrame->GetFrameForPoint(aPt - aBuilder->ToReferenceFrame(mFrame));
return NS_STATIC_CAST(nsSVGOuterSVGFrame*, mFrame)->
GetFrameForPoint(aPt - aBuilder->ToReferenceFrame(mFrame));
}
void
nsDisplaySVG::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect)
{
mFrame->Paint(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsSVGOuterSVGFrame*, mFrame)->
Paint(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
}
nsIFrame*

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

@ -357,7 +357,7 @@ nsTableCellFrame::PaintCellBackground(nsIRenderingContext& aRenderingContext,
MOZ_DECL_CTOR_COUNTER(nsDisplayTableCellBackground)
class nsDisplayTableCellBackground : public nsDisplayItem {
public:
nsDisplayTableCellBackground(nsTableCellFrame* aFrame) : mFrame(aFrame) {
nsDisplayTableCellBackground(nsTableCellFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableCellBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -366,19 +366,17 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("TableCellBackground")
private:
nsTableCellFrame* mFrame;
};
void nsDisplayTableCellBackground::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintBackground(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsTableCellFrame*, mFrame)->
PaintBackground(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
}
static void

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

@ -1342,7 +1342,7 @@ nsTableFrame::GetAdditionalChildListName(PRInt32 aIndex) const
MOZ_DECL_CTOR_COUNTER(nsDisplayTableBorderBackground)
class nsDisplayTableBorderBackground : public nsDisplayItem {
public:
nsDisplayTableBorderBackground(nsTableFrame* aFrame) : mFrame(aFrame) {
nsDisplayTableBorderBackground(nsTableFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableBorderBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1351,26 +1351,25 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
// With collapsed borders, parts of the collapsed border can extend outside
// the table frame, so allow this display element to blow out to our
// overflow rect.
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) {
return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame);
return NS_STATIC_CAST(nsTableFrame*, mFrame)->GetOverflowRect() +
aBuilder->ToReferenceFrame(mFrame);
}
NS_DISPLAY_DECL_NAME("TableBorderBackground")
private:
nsTableFrame* mFrame;
};
void
nsDisplayTableBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintTableBorderBackground(*aCtx, aDirtyRect,
aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsTableFrame*, mFrame)->
PaintTableBorderBackground(*aCtx, aDirtyRect,
aBuilder->ToReferenceFrame(mFrame));
}
/* static */ nsresult

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

@ -558,7 +558,7 @@ nsTableRowFrame::CalcHeight(const nsHTMLReflowState& aReflowState)
MOZ_DECL_CTOR_COUNTER(nsDisplayTableRowBackground)
class nsDisplayTableRowBackground : public nsDisplayItem {
public:
nsDisplayTableRowBackground(nsTableRowFrame* aFrame) : mFrame(aFrame) {
nsDisplayTableRowBackground(nsTableRowFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableRowBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -571,14 +571,12 @@ public:
// the overflow rect contains any row-spanning cells, so it contains
// our background. Note that this means we may not be opaque even if
// the background style is a solid color.
return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame);
return NS_STATIC_CAST(nsTableRowFrame*, mFrame)->GetOverflowRect() +
aBuilder->ToReferenceFrame(mFrame);
}
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("TableRowBackground")
private:
nsTableRowFrame* mFrame;
};
void
@ -593,7 +591,7 @@ nsDisplayTableRowBackground::Paint(nsDisplayListBuilder* aBuilder,
TableBackgroundPainter::eOrigin_TableRow,
mFrame->GetPresContext(), *aCtx,
aDirtyRect - pt);
painter.PaintRow(mFrame);
painter.PaintRow(NS_STATIC_CAST(nsTableRowFrame*, mFrame));
}
NS_IMETHODIMP

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

@ -1361,7 +1361,7 @@ nsBoxFrame::GetDebugPref(nsPresContext* aPresContext)
MOZ_DECL_CTOR_COUNTER(nsDisplayXULDebug)
class nsDisplayXULDebug : public nsDisplayItem {
public:
nsDisplayXULDebug(nsComboboxControlFrame* aFrame) : mFrame(aFrame) {
nsDisplayXULDebug(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULDebug);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1370,23 +1370,22 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) {
mFrame->DisplayDebugInfoFor(this, aPt - aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsBoxFrame*, mFrame)->
DisplayDebugInfoFor(this, aPt - aBuilder->ToReferenceFrame(mFrame));
return PR_TRUE;
}
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("ComboboxFocus")
private:
nsBoxFrame* mFrame;
};
void
nsDisplayXULDebug::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintXULDebugOverlay(*aCtx, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsBoxFrame*, mFrame)->
PaintXULDebugOverlay(*aCtx, aBuilder->ToReferenceFrame(mFrame));
}
static void
@ -2438,7 +2437,6 @@ public:
nsIFrame* aTargetFrame)
: nsDisplayWrapList(aFrame, aList), mTargetFrame(aTargetFrame) {}
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt);
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
NS_DISPLAY_DECL_NAME("XULEventRedirector")
private:
nsIFrame* mTargetFrame;

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

@ -105,7 +105,7 @@ nsGroupBoxFrame::nsGroupBoxFrame(nsIPresShell* aShell):nsBoxFrame(aShell)
MOZ_DECL_CTOR_COUNTER(nsDisplayXULGroupBackground)
class nsDisplayXULGroupBackground : public nsDisplayItem {
public:
nsDisplayXULGroupBackground(nsGroupBoxFrame* aFrame) : mFrame(aFrame) {
nsDisplayXULGroupBackground(nsGroupBoxFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULGroupBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -114,21 +114,18 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("XULGroupBackground")
private:
nsGroupBoxFrame* mFrame;
};
void
nsDisplayXULGroupBackground::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame),
aDirtyRect);
NS_STATIC_CAST(nsGroupBoxFrame*, mFrame)->
PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame), aDirtyRect);
}
NS_IMETHODIMP

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

@ -390,7 +390,7 @@ nsImageBoxFrame::UpdateLoadFlags()
MOZ_DECL_CTOR_COUNTER(nsDisplayXULImage)
class nsDisplayXULImage : public nsDisplayItem {
public:
nsDisplayXULImage(nsImageBoxFrame* aFrame) : mFrame(aFrame) {
nsDisplayXULImage(nsImageBoxFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULImage);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -399,20 +399,18 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
// Doesn't handle HitTest because nsLeafBoxFrame already creates an
// event receiver for us
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("XULImage")
private:
nsImageBoxFrame* mFrame;
};
void nsDisplayXULImage::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintImage(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsImageBoxFrame*, mFrame)->
PaintImage(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
}
NS_IMETHODIMP

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

@ -278,7 +278,7 @@ nsTextBoxFrame::UpdateAttributes(nsPresContext* aPresContext,
MOZ_DECL_CTOR_COUNTER(nsDisplayXULTextBox)
class nsDisplayXULTextBox : public nsDisplayItem {
public:
nsDisplayXULTextBox(nsTextBoxFrame* aFrame) : mFrame(aFrame) {
nsDisplayXULTextBox(nsTextBoxFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULTextBox);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -287,18 +287,16 @@ public:
}
#endif
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("XULTextBox")
private:
nsTextBoxFrame* mFrame;
};
void nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
{
mFrame->PaintTitle(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
NS_STATIC_CAST(nsTextBoxFrame*, mFrame)->
PaintTitle(*aCtx, aDirtyRect, aBuilder->ToReferenceFrame(mFrame));
}
NS_IMETHODIMP

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

@ -116,7 +116,7 @@ nsTreeColFrame::Destroy(nsPresContext* aPresContext)
MOZ_DECL_CTOR_COUNTER(nsDisplayXULTreeColSplitterTarget)
class nsDisplayXULTreeColSplitterTarget : public nsDisplayItem {
public:
nsDisplayXULTreeColSplitterTarget(nsIFrame* aFrame) : mFrame(aFrame) {
nsDisplayXULTreeColSplitterTarget(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
MOZ_COUNT_CTOR(nsDisplayXULTreeColSplitterTarget);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -126,10 +126,7 @@ public:
#endif
virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt);
virtual nsIFrame* GetUnderlyingFrame() { return mFrame; }
NS_DISPLAY_DECL_NAME("XULTreeColSplitterTarget")
private:
nsIFrame* mFrame;
};
nsIFrame*