Bug 497495 part 3: Add methods to every nsFrame subclass that expose the as-allocated identity of every frame object. Also some cleanups to the QueryFrame implementation. r=dbaron sr=roc

This commit is contained in:
Zack Weinberg 2009-09-12 17:49:24 +01:00
parent e9d19c5ee2
commit 17eb5a6efc
267 changed files with 689 additions and 153 deletions

View File

@ -51,7 +51,7 @@ class nsPresContext;
class nsIPercentHeightObserver
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIPercentHeightObserver)
NS_DECL_QUERYFRAME_TARGET(nsIPercentHeightObserver)
// Notify the observer that aReflowState has no computed height, but it has a percent height
virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) = 0;

View File

@ -172,6 +172,8 @@ NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, P
return it;
}
NS_IMPL_FRAMEARENA_HELPERS(nsComboboxControlFrame)
//-----------------------------------------------------------
// Reflow Debugging Macros
// These let us "see" how many reflow counts are happening
@ -1052,6 +1054,8 @@ nsComboboxControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
// need to revisit this.
class nsComboboxDisplayFrame : public nsBlockFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
nsComboboxDisplayFrame (nsStyleContext* aContext,
nsComboboxControlFrame* aComboBox)
: nsBlockFrame(aContext),
@ -1081,6 +1085,8 @@ protected:
nsComboboxControlFrame* mComboBox;
};
NS_IMPL_FRAMEARENA_HELPERS(nsComboboxDisplayFrame)
nsIAtom*
nsComboboxDisplayFrame::GetType() const
{

View File

@ -97,6 +97,7 @@ public:
~nsComboboxControlFrame();
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
NS_DECL_ISUPPORTS_INHERITED
// nsIAnonymousContentCreator

View File

@ -66,6 +66,7 @@ class nsLegendFrame;
class nsFieldSetFrame : public nsHTMLContainerFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
nsFieldSetFrame(nsStyleContext* aContext);
@ -133,6 +134,8 @@ NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsFieldSetFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsFieldSetFrame)
nsFieldSetFrame::nsFieldSetFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext)
{

View File

@ -87,6 +87,8 @@ NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsFileControlFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsFileControlFrame)
nsFileControlFrame::nsFileControlFrame(nsStyleContext* aContext):
nsBlockFrame(aContext),
mTextFrame(nsnull),

View File

@ -64,6 +64,7 @@ public:
const nsDisplayListSet& aLists);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsIFormControlFrame
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue);

View File

@ -66,6 +66,8 @@ NS_QUERYFRAME_HEAD(nsFormControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsLeafFrame)
NS_IMPL_FRAMEARENA_HELPERS(nsFormControlFrame)
nscoord
nsFormControlFrame::GetIntrinsicWidth()
{

View File

@ -49,7 +49,6 @@
class nsFormControlFrame : public nsLeafFrame,
public nsIFormControlFrame
{
public:
/**
* Main constructor
@ -65,6 +64,7 @@ public:
}
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
/**
* Respond to a gui event

View File

@ -70,6 +70,8 @@ NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsGfxButtonControlFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsGfxButtonControlFrame)
void nsGfxButtonControlFrame::Destroy()
{
nsContentUtils::DestroyAnonymousContent(&mTextContent);

View File

@ -56,6 +56,8 @@ class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame,
public nsIAnonymousContentCreator
{
public:
NS_DECL_FRAMEARENA_HELPERS
nsGfxButtonControlFrame(nsStyleContext* aContext);
virtual void Destroy();

View File

@ -105,6 +105,8 @@ NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell,
return new (aPresShell) nsGfxCheckboxControlFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsGfxCheckboxControlFrame)
//------------------------------------------------------------
// Initialize GFX-rendered state

View File

@ -48,6 +48,8 @@ class nsGfxCheckboxControlFrame : public nsFormControlFrame,
public nsICheckboxControlFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
nsGfxCheckboxControlFrame(nsStyleContext* aContext);
virtual ~nsGfxCheckboxControlFrame();

View File

@ -53,6 +53,8 @@ NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsGfxRadioControlFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsGfxRadioControlFrame)
nsGfxRadioControlFrame::nsGfxRadioControlFrame(nsStyleContext* aContext):
nsFormControlFrame(aContext)
{

View File

@ -56,6 +56,7 @@ public:
~nsGfxRadioControlFrame();
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
#ifdef ACCESSIBILITY
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);

View File

@ -74,6 +74,8 @@ NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsHTMLButtonControlFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLButtonControlFrame)
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext)
{

View File

@ -62,10 +62,10 @@ public:
nsHTMLButtonControlFrame(nsStyleContext* aContext);
~nsHTMLButtonControlFrame();
virtual void Destroy();
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

View File

@ -49,7 +49,7 @@ class nsPresContext;
class nsICheckboxControlFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsICheckboxControlFrame)
NS_DECL_QUERYFRAME_TARGET(nsICheckboxControlFrame)
/**
* Called by content when checkbox "checked" changes

View File

@ -54,7 +54,7 @@ class nsCSSFrameConstructor;
class nsIComboboxControlFrame : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIComboboxControlFrame)
NS_DECL_QUERYFRAME_TARGET(nsIComboboxControlFrame)
/**
* Indicates whether the list is dropped down

View File

@ -52,7 +52,7 @@ struct nsSize;
class nsIFormControlFrame : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIFormControlFrame)
NS_DECL_QUERYFRAME_TARGET(nsIFormControlFrame)
/**
*

View File

@ -50,7 +50,7 @@ class nsIContent;
class nsIListControlFrame : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIListControlFrame)
NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame)
/**
* Sets the ComboBoxFrame

View File

@ -48,7 +48,7 @@ class nsStyleContext;
class nsIRadioControlFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIRadioControlFrame)
NS_DECL_QUERYFRAME_TARGET(nsIRadioControlFrame)
/**
* Called by content when the radio button's state changes

View File

@ -49,7 +49,7 @@ class nsIDOMHTMLOptionElement;
class nsISelectControlFrame : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsISelectControlFrame)
NS_DECL_QUERYFRAME_TARGET(nsISelectControlFrame)
/**
* Adds an option to the list at index

View File

@ -48,7 +48,7 @@ class nsFrameSelection;
class nsITextControlFrame : public nsIFormControlFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsITextControlFrame)
NS_DECL_QUERYFRAME_TARGET(nsITextControlFrame)
NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0;

View File

@ -82,6 +82,7 @@ public:
nsIFrame* aPrevInFlow);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -137,6 +138,8 @@ NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsImageControlFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsImageControlFrame)
NS_IMETHODIMP
nsImageControlFrame::Init(nsIContent* aContent,
nsIFrame* aParent,

View File

@ -84,6 +84,8 @@ NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsIsIndexFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsIsIndexFrame)
nsIsIndexFrame::nsIsIndexFrame(nsStyleContext* aContext) :
nsBlockFrame(aContext)
{

View File

@ -82,6 +82,7 @@ public:
NS_IMETHOD KeyPress(nsIDOMEvent* aKeyEvent); // we only care when a key is pressed
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

View File

@ -60,6 +60,8 @@ NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return f;
}
NS_IMPL_FRAMEARENA_HELPERS(nsLegendFrame)
nsIAtom*
nsLegendFrame::GetType() const
{

View File

@ -42,12 +42,12 @@
class nsLegendFrame : public nsBlockFrame {
public:
NS_DECLARE_FRAME_ACCESSOR(nsLegendFrame)
NS_DECL_QUERYFRAME_TARGET(nsLegendFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
NS_DECL_QUERYFRAME
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,

View File

@ -164,6 +164,8 @@ NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return it;
}
NS_IMPL_FRAMEARENA_HELPERS(nsListControlFrame)
//---------------------------------------------------------
nsListControlFrame::nsListControlFrame(
nsIPresShell* aShell, nsIDocument* aDocument, nsStyleContext* aContext)

View File

@ -78,6 +78,7 @@ public:
friend nsIFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,

View File

@ -56,6 +56,8 @@ NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRUint32
return it;
}
NS_IMPL_FRAMEARENA_HELPERS(nsSelectsAreaFrame)
//---------------------------------------------------------
PRBool
nsSelectsAreaFrame::IsOptionElement(nsIContent* aContent)

View File

@ -43,6 +43,8 @@ class nsIContent;
class nsSelectsAreaFrame : public nsBlockFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRUint32 aFlags);
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,

View File

@ -951,12 +951,13 @@ NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsTextControlFrame(aPresShell, aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsTextControlFrame)
NS_QUERYFRAME_HEAD(nsTextControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_ENTRY(nsITextControlFrame)
if (nsIScrollableViewProvider::kFrameIID == id && IsScrollable())
return static_cast<nsIScrollableViewProvider*>(this);
NS_QUERYFRAME_ENTRY_CONDITIONAL(nsIScrollableViewProvider, IsScrollable())
NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
#ifdef ACCESSIBILITY

View File

@ -69,6 +69,8 @@ class nsTextControlFrame : public nsStackFrame,
{
public:
NS_DECL_FRAMEARENA_HELPERS
nsTextControlFrame(nsIPresShell* aShell, nsStyleContext* aContext);
virtual ~nsTextControlFrame();

View File

@ -61,6 +61,8 @@
class BRFrame : public nsFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual ContentOffsets CalcContentOffsetsFromFramePoint(nsPoint aPoint);
@ -103,6 +105,8 @@ NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) BRFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(BRFrame)
BRFrame::~BRFrame()
{
}

View File

@ -71,4 +71,6 @@ NS_NewDirectionalFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUni
return new (aPresShell) nsDirectionalFrame(aContext, aChar);
}
NS_IMPL_FRAMEARENA_HELPERS(nsDirectionalFrame)
#endif /* IBMBIDI */

View File

@ -50,6 +50,8 @@ protected:
virtual ~nsDirectionalFrame();
public:
NS_DECL_FRAMEARENA_HELPERS
nsDirectionalFrame(nsStyleContext* aContext, PRUnichar aChar);
/**

View File

@ -276,6 +276,8 @@ NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aF
return it;
}
NS_IMPL_FRAMEARENA_HELPERS(nsBlockFrame)
nsBlockFrame::~nsBlockFrame()
{
}

View File

@ -137,7 +137,8 @@ class nsIntervalSet;
class nsBlockFrame : public nsBlockFrameSuper
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsBlockFrame)
NS_DECL_QUERYFRAME_TARGET(nsBlockFrame)
NS_DECL_FRAMEARENA_HELPERS
typedef nsLineList::iterator line_iterator;
typedef nsLineList::const_iterator const_line_iterator;

View File

@ -84,6 +84,7 @@ private:
nsBulletFrame *mFrame;
};
NS_IMPL_FRAMEARENA_HELPERS(nsBulletFrame)
nsBulletFrame::~nsBulletFrame()
{

View File

@ -52,6 +52,8 @@
*/
class nsBulletFrame : public nsFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
nsBulletFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
virtual ~nsBulletFrame();

View File

@ -54,6 +54,8 @@
class nsColumnSetFrame : public nsHTMLContainerFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
nsColumnSetFrame(nsStyleContext* aContext);
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
@ -192,6 +194,8 @@ NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint3
return it;
}
NS_IMPL_FRAMEARENA_HELPERS(nsColumnSetFrame)
nsColumnSetFrame::nsColumnSetFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext), mLastBalanceHeight(NS_INTRINSICSIZE),
mLastFrameStatus(NS_FRAME_COMPLETE)

View File

@ -80,6 +80,8 @@
#undef NOISY
#endif
NS_IMPL_FRAMEARENA_HELPERS(nsContainerFrame)
nsContainerFrame::~nsContainerFrame()
{
}

View File

@ -73,6 +73,8 @@ class nsOverflowContinuationTracker;
class nsContainerFrame : public nsSplittableFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame overrides
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,

View File

@ -54,6 +54,8 @@ NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsFirstLetterFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsFirstLetterFrame)
#ifdef NS_DEBUG
NS_IMETHODIMP
nsFirstLetterFrame::GetFrameName(nsAString& aResult) const

View File

@ -46,6 +46,8 @@
class nsFirstLetterFrame : public nsFirstLetterFrameSuper {
public:
NS_DECL_FRAMEARENA_HELPERS
nsFirstLetterFrame(nsStyleContext* aContext) : nsHTMLContainerFrame(aContext) {}
NS_IMETHOD Init(nsIContent* aContent,

View File

@ -288,30 +288,6 @@ NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsFrame(aContext);
}
// Overloaded new operator. Relies on an arena (which comes from the
// presShell) to perform the allocation.
void*
nsFrame::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW
{
return aPresShell->AllocateFrame(sz, 0 /* dummy */);
}
// Overridden to prevent the global delete from being called, since the memory
// came out of an nsIArena instead of the global delete operator's heap.
void
nsFrame::operator delete(void* aPtr, size_t sz)
{
// Don't let the memory be freed, since it will be recycled
// instead. Don't call the global operator delete.
// Stash the size of the object in the first four bytes of the
// freed up memory. The Destroy method can then use this information
// to recycle the object.
size_t* szPtr = (size_t*)aPtr;
*szPtr = sz;
}
nsFrame::nsFrame(nsStyleContext* aContext)
{
MOZ_COUNT_CTOR(nsFrame);
@ -330,9 +306,19 @@ nsFrame::~nsFrame()
mStyleContext->Release();
}
NS_IMPL_FRAMEARENA_HELPERS(nsFrame)
// Dummy operator delete. Will never be called, but must be defined
// to satisfy some C++ ABIs.
void
nsFrame::operator delete(void *, size_t)
{
NS_RUNTIMEABORT("nsFrame::operator delete should never be called");
}
NS_QUERYFRAME_HEAD(nsFrame)
NS_QUERYFRAME_ENTRY(nsIFrame)
NS_QUERYFRAME_TAIL
NS_QUERYFRAME_TAIL_INHERITANCE_ROOT
/////////////////////////////////////////////////////////////////////////////
// nsIFrame
@ -470,14 +456,20 @@ nsFrame::Destroy()
view->Destroy();
}
// Deleting the frame doesn't really free the memory, since we're using an
// arena for allocation, but we will get our destructors called.
delete this;
// Must retrieve the object size before calling destructors, so the
// vtable is still valid.
//
// Note to future tweakers: having the method that returns the
// object size call the destructor will not avoid an indirect call;
// the compiler cannot devirtualize the call to the destructor even
// if it's from a method defined in the same class.
// Now that we're totally cleaned out, we need to add ourselves to the presshell's
// recycler.
size_t* sz = (size_t*)this;
shell->FreeFrame(*sz, 0 /* dummy */, (void*)this);
size_t sz = GetAllocatedSize();
this->~nsFrame();
// Now that we're totally cleaned out, we need to add ourselves to
// the presshell's recycler.
shell->FreeFrame(sz, 0 /* dummy */, (void*)this);
}
NS_IMETHODIMP

View File

@ -110,6 +110,22 @@
#define NS_FRAME_TRACE_REFLOW_OUT(_method, _status)
#endif
// Frame allocation boilerplate macros. Every subclass of nsFrame
// must define its own operator new and GetAllocatedSize. If they do
// not, the per-frame recycler lists in nsPresArena will not work
// correctly, with potentially catastrophic consequences (not enough
// memory is allocated for a frame object).
#define NS_DECL_FRAMEARENA_HELPERS \
NS_MUST_OVERRIDE void* operator new(size_t, nsIPresShell*); \
virtual NS_MUST_OVERRIDE size_t GetAllocatedSize();
#define NS_IMPL_FRAMEARENA_HELPERS(class) \
void* class::operator new(size_t sz, nsIPresShell* aShell) \
{ return aShell->AllocateFrame(sz, nsQueryFrame::class##_id); } \
size_t class::GetAllocatedSize() \
{ return sizeof(class); }
//----------------------------------------------------------------------
struct nsBoxLayoutMetrics;
@ -131,10 +147,6 @@ public:
friend nsIFrame* NS_NewEmptyFrame(nsIPresShell* aShell,
nsStyleContext* aContext);
// Overloaded new operator. Relies on an arena (which comes from the
// presShell) to perform the allocation.
void* operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW;
private:
// Left undefined; nsFrame objects are never allocated from the heap.
void* operator new(size_t sz) CPP_THROW_NEW;
@ -156,6 +168,7 @@ public:
// nsQueryFrame
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame
NS_IMETHOD Init(nsIContent* aContent,

View File

@ -113,6 +113,8 @@ class nsSubDocumentFrame : public nsLeafFrame,
public nsIReflowCallback
{
public:
NS_DECL_FRAMEARENA_HELPERS
nsSubDocumentFrame(nsStyleContext* aContext);
#ifdef DEBUG
@ -757,6 +759,8 @@ NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsSubDocumentFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsSubDocumentFrame)
void
nsSubDocumentFrame::Destroy()
{

View File

@ -129,9 +129,11 @@ void nsFramesetDrag::UnSet()
/*******************************************************************************
* nsHTMLFramesetBorderFrame
******************************************************************************/
class nsHTMLFramesetBorderFrame : public nsLeafFrame {
class nsHTMLFramesetBorderFrame : public nsLeafFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif
@ -179,9 +181,11 @@ protected:
/*******************************************************************************
* nsHTMLFramesetBlankFrame
******************************************************************************/
class nsHTMLFramesetBlankFrame : public nsLeafFrame {
class nsHTMLFramesetBlankFrame : public nsLeafFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
#ifdef DEBUG
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
#endif
@ -1603,6 +1607,8 @@ NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsHTMLFramesetFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLFramesetFrame)
/*******************************************************************************
* nsHTMLFramesetBorderFrame
******************************************************************************/
@ -1624,6 +1630,8 @@ nsHTMLFramesetBorderFrame::~nsHTMLFramesetBorderFrame()
//printf("nsHTMLFramesetBorderFrame destructor %p \n", this);
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLFramesetBorderFrame)
nscoord nsHTMLFramesetBorderFrame::GetIntrinsicWidth()
{
// No intrinsic width
@ -1836,6 +1844,8 @@ NS_IMETHODIMP nsHTMLFramesetBorderFrame::GetFrameName(nsAString& aResult) const
* nsHTMLFramesetBlankFrame
******************************************************************************/
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLFramesetBlankFrame)
nsHTMLFramesetBlankFrame::~nsHTMLFramesetBlankFrame()
{
//printf("nsHTMLFramesetBlankFrame destructor %p \n", this);

View File

@ -104,14 +104,14 @@ struct nsFramesetDrag {
class nsHTMLFramesetFrame : public nsHTMLContainerFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsHTMLFramesetFrame)
NS_DECL_QUERYFRAME_TARGET(nsHTMLFramesetFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
nsHTMLFramesetFrame(nsStyleContext* aContext);
virtual ~nsHTMLFramesetFrame();
NS_DECL_QUERYFRAME
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);

View File

@ -90,6 +90,8 @@ NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool
return new (aPresShell) nsHTMLScrollFrame(aPresShell, aContext, aIsRoot);
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLScrollFrame)
nsHTMLScrollFrame::nsHTMLScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRBool aIsRoot)
: nsHTMLContainerFrame(aContext),
mInner(this, aIsRoot, PR_FALSE)
@ -945,6 +947,8 @@ NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool
return new (aPresShell) nsXULScrollFrame(aPresShell, aContext, aIsRoot);
}
NS_IMPL_FRAMEARENA_HELPERS(nsXULScrollFrame)
nsXULScrollFrame::nsXULScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRBool aIsRoot)
: nsBoxFrame(aShell, aContext, aIsRoot),
mInner(this, aIsRoot, PR_TRUE)

View File

@ -251,6 +251,7 @@ public:
friend nsIFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
@ -436,6 +437,7 @@ class nsXULScrollFrame : public nsBoxFrame,
public nsIStatefulFrame {
public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot);

View File

@ -92,6 +92,8 @@ NS_NewHTMLCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsHTMLCanvasFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLCanvasFrame)
nsHTMLCanvasFrame::~nsHTMLCanvasFrame()
{
}

View File

@ -51,6 +51,8 @@ nsIFrame* NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, nsStyleContext* aCont
class nsHTMLCanvasFrame : public nsSplittableFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
nsHTMLCanvasFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,

View File

@ -737,3 +737,5 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame,
aFrame));
return NS_OK;
}
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLContainerFrame)

View File

@ -69,6 +69,7 @@ class nsDisplayTextDecoration;
// functionality.
class nsHTMLContainerFrame : public nsContainerFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
/**
* Helper method to create next-in-flows if necessary. If aFrame

View File

@ -87,6 +87,7 @@ public:
mAbsoluteContainer(nsGkAtoms::absoluteList) {}
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsISupports (nsIScrollPositionListener)
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -190,6 +191,8 @@ NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) CanvasFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(CanvasFrame)
NS_IMPL_QUERY_INTERFACE1(CanvasFrame, nsIScrollPositionListener)
NS_QUERYFRAME_HEAD(CanvasFrame)

View File

@ -58,7 +58,7 @@ template <class T> class nsTArray;
class nsIAnonymousContentCreator
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIAnonymousContentCreator)
NS_DECL_QUERYFRAME_TARGET(nsIAnonymousContentCreator)
/**
* Creates "native" anonymous content and adds the created content to

View File

@ -45,7 +45,7 @@
class nsICanvasFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsICanvasFrame)
NS_DECL_QUERYFRAME_TARGET(nsICanvasFrame)
/** SetHasFocus tells the CanvasFrame to draw with focus ring
* @param aHasFocus PR_TRUE to show focus ring, PR_FALSE to hide it

View File

@ -490,7 +490,7 @@ typedef PRBool nsDidReflowStatus;
class nsIFrame : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIFrame)
NS_DECL_QUERYFRAME_TARGET(nsIFrame)
nsPresContext* PresContext() const {
return GetStyleContext()->GetRuleNode()->GetPresContext();

View File

@ -48,7 +48,7 @@ class nsIDocShell;
class nsIFrameFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIFrameFrame)
NS_DECL_QUERYFRAME_TARGET(nsIFrameFrame)
NS_IMETHOD GetDocShell(nsIDocShell **aDocShell) = 0;

View File

@ -51,7 +51,7 @@ class nsIImageMap;
class nsIImageFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIImageFrame)
NS_DECL_QUERYFRAME_TARGET(nsIImageFrame)
NS_IMETHOD GetIntrinsicImageSize(nsSize& aSize) = 0;

View File

@ -50,7 +50,7 @@ class nsIPluginInstance;
class nsIObjectFrame : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIObjectFrame)
NS_DECL_QUERYFRAME_TARGET(nsIObjectFrame)
NS_IMETHOD GetPluginInstance(nsIPluginInstance*& aPluginInstance) = 0;

View File

@ -51,7 +51,7 @@ class nsIPrintSettings;
class nsIPageSequenceFrame : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIPageSequenceFrame)
NS_DECL_QUERYFRAME_TARGET(nsIPageSequenceFrame)
/**
* Print the set of pages.

View File

@ -55,7 +55,7 @@ class nsBoxLayoutState;
class nsIScrollableFrame : public nsIScrollableViewProvider {
public:
NS_DECLARE_FRAME_ACCESSOR(nsIScrollableFrame)
NS_DECL_QUERYFRAME_TARGET(nsIScrollableFrame)
/**
* Get the frame that we are scrolling within the scrollable frame.

View File

@ -46,7 +46,7 @@ class nsIScrollableView;
class nsIScrollableViewProvider : public nsQueryFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIScrollableViewProvider)
NS_DECL_QUERYFRAME_TARGET(nsIScrollableViewProvider)
virtual nsIScrollableView* GetScrollableView() = 0;
};

View File

@ -14,7 +14,7 @@ class nsPresState;
class nsIStatefulFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIStatefulFrame)
NS_DECL_QUERYFRAME_TARGET(nsIStatefulFrame)
// If you create a special type stateful frame (e.g. scroll) that needs
// to be captured outside of the standard pass through the frames, you'll need

View File

@ -161,6 +161,8 @@ NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsImageFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsImageFrame)
nsImageFrame::nsImageFrame(nsStyleContext* aContext) :
ImageFrameSuper(aContext),

View File

@ -94,6 +94,8 @@ private:
class nsImageFrame : public ImageFrameSuper, public nsIImageFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
nsImageFrame(nsStyleContext* aContext);
NS_DECL_QUERYFRAME

View File

@ -73,6 +73,8 @@ NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsInlineFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsInlineFrame)
NS_QUERYFRAME_HEAD(nsInlineFrame)
NS_QUERYFRAME_ENTRY(nsInlineFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsInlineFrameSuper)
@ -902,6 +904,8 @@ NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsFirstLineFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsFirstLineFrame)
#ifdef DEBUG
NS_IMETHODIMP
nsFirstLineFrame::GetFrameName(nsAString& aResult) const
@ -1080,6 +1084,8 @@ NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsPositionedInlineFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsPositionedInlineFrame)
void
nsPositionedInlineFrame::Destroy()
{

View File

@ -76,8 +76,9 @@ class nsAnonymousBlockFrame;
class nsInlineFrame : public nsInlineFrameSuper
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsInlineFrame)
NS_DECL_QUERYFRAME_TARGET(nsInlineFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
@ -213,6 +214,8 @@ protected:
*/
class nsFirstLineFrame : public nsInlineFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
#ifdef DEBUG
@ -247,6 +250,8 @@ protected:
class nsPositionedInlineFrame : public nsInlineFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
nsPositionedInlineFrame(nsStyleContext* aContext)
: nsInlineFrame(aContext)
, mAbsoluteContainer(nsGkAtoms::absoluteList)

View File

@ -48,6 +48,8 @@ nsLeafFrame::~nsLeafFrame()
{
}
NS_IMPL_FRAMEARENA_HELPERS(nsLeafFrame)
/* virtual */ nscoord
nsLeafFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
{

View File

@ -51,6 +51,7 @@
*/
class nsLeafFrame : public nsFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame replacements
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,

View File

@ -2357,6 +2357,8 @@ NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsObjectFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsObjectFrame)
// nsPluginDOMContextMenuListener class implementation

View File

@ -63,6 +63,8 @@ class nsDisplayPlugin;
class nsObjectFrame : public nsObjectFrameSuper, public nsIObjectFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_QUERYFRAME

View File

@ -56,6 +56,8 @@ NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsPageContentFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsPageContentFrame)
/* virtual */ nsSize
nsPageContentFrame::ComputeSize(nsIRenderingContext *aRenderingContext,
nsSize aCBSize, nscoord aAvailableWidth,

View File

@ -45,6 +45,8 @@ class nsSharedPageData;
class nsPageContentFrame : public ViewportFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
friend class nsPageFrame;

View File

@ -71,6 +71,8 @@ NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsPageFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsPageFrame)
nsPageFrame::nsPageFrame(nsStyleContext* aContext)
: nsContainerFrame(aContext)
{
@ -606,6 +608,8 @@ NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsPageBreakFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsPageBreakFrame)
nsPageBreakFrame::nsPageBreakFrame(nsStyleContext* aContext) :
nsLeafFrame(aContext), mHaveReflowed(PR_FALSE)
{

View File

@ -46,6 +46,8 @@ class nsSharedPageData;
class nsPageFrame : public nsContainerFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -128,7 +130,9 @@ protected:
};
class nsPageBreakFrame : public nsLeafFrame {
class nsPageBreakFrame : public nsLeafFrame
{
NS_DECL_FRAMEARENA_HELPERS
nsPageBreakFrame(nsStyleContext* aContext);
~nsPageBreakFrame();

View File

@ -56,6 +56,8 @@ NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsPlaceholderFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsPlaceholderFrame)
nsPlaceholderFrame::~nsPlaceholderFrame()
{
}

View File

@ -85,6 +85,8 @@ nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aCont
*/
class nsPlaceholderFrame : public nsFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
/**
* Create a new placeholder frame
*/

View File

@ -40,23 +40,34 @@
#include "nscore.h"
#define NS_DECLARE_FRAME_ACCESSOR(classname) \
#define NS_DECL_QUERYFRAME_TARGET(classname) \
static const nsQueryFrame::FrameIID kFrameIID = nsQueryFrame::classname##_id;
#define NS_DECL_QUERYFRAME \
virtual void* QueryFrame(FrameIID id);
#define NS_QUERYFRAME_HEAD(class) \
void* class::QueryFrame(FrameIID id) {
void* class::QueryFrame(FrameIID id) { switch (id) {
#define NS_QUERYFRAME_ENTRY(class) \
if (class::kFrameIID == id) \
return static_cast<class*>(this);
case class::kFrameIID: return static_cast<class*>(this);
#define NS_QUERYFRAME_ENTRY_CONDITIONAL(class, condition) \
case class::kFrameIID: \
if (condition) return static_cast<class*>(this); \
break;
#define NS_QUERYFRAME_TAIL_INHERITING(class) \
return class::QueryFrame(id); }
default: break; \
} \
return class::QueryFrame(id); \
}
#define NS_QUERYFRAME_TAIL return nsnull; }
#define NS_QUERYFRAME_TAIL_INHERITANCE_ROOT \
default: break; \
} \
return nsnull; \
}
class nsQueryFrame
{
@ -64,7 +75,6 @@ public:
enum FrameIID {
BRFrame_id,
CanvasFrame_id,
nsAreaFrame_id,
nsAutoRepeatBoxFrame_id,
nsBCTableCellFrame_id,
nsBlockFrame_id,
@ -148,6 +158,7 @@ public:
nsMathMLmactionFrame_id,
nsMathMLmathBlockFrame_id,
nsMathMLmathInlineFrame_id,
nsMathMLmencloseFrame_id,
nsMathMLmfencedFrame_id,
nsMathMLmfracFrame_id,
nsMathMLmmultiscriptsFrame_id,
@ -237,6 +248,7 @@ public:
nsTreeBodyFrame_id,
nsTreeColFrame_id,
nsVideoFrame_id,
nsXULLabelFrame_id,
nsXULScrollFrame_id,
SpacerFrame_id,
ViewportFrame_id

View File

@ -110,6 +110,8 @@ NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext
return new (aPresShell) nsSimplePageSequenceFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsSimplePageSequenceFrame)
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(nsStyleContext* aContext) :
nsContainerFrame(aContext),
mTotalPages(-1),

View File

@ -85,6 +85,7 @@ public:
friend nsIFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame
NS_IMETHOD Reflow(nsPresContext* aPresContext,

View File

@ -50,8 +50,11 @@
#define TYPE_LINE 1 // line-break + vertical space
#define TYPE_IMAGE 2 // acts like a sized image with nothing to see
class SpacerFrame : public nsFrame {
class SpacerFrame : public nsFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsIHTMLReflow
@ -82,6 +85,8 @@ NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) SpacerFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(SpacerFrame)
SpacerFrame::~SpacerFrame()
{
}

View File

@ -45,6 +45,8 @@
#include "nsPresContext.h"
#include "nsStyleContext.h"
NS_IMPL_FRAMEARENA_HELPERS(nsSplittableFrame)
NS_IMETHODIMP
nsSplittableFrame::Init(nsIContent* aContent,
nsIFrame* aParent,

View File

@ -49,6 +49,8 @@
class nsSplittableFrame : public nsFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);

View File

@ -70,6 +70,8 @@ class PropertyProvider;
class nsTextFrame : public nsFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend class nsContinuingTextFrame;
nsTextFrame(nsStyleContext* aContext) : nsFrame(aContext)

View File

@ -3429,6 +3429,8 @@ nsTextFrame::Destroy()
class nsContinuingTextFrame : public nsTextFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD Init(nsIContent* aContent,
@ -3682,12 +3684,16 @@ NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsTextFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsTextFrame)
nsIFrame*
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsContinuingTextFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsContinuingTextFrame)
nsTextFrame::~nsTextFrame()
{
if (0 != (mState & TEXT_BLINK_ON_OR_PRINTING) && PresContext()->IsDynamic())

View File

@ -70,6 +70,8 @@ NS_NewHTMLVideoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsVideoFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsVideoFrame)
nsVideoFrame::nsVideoFrame(nsStyleContext* aContext) :
nsContainerFrame(aContext)
{

View File

@ -58,6 +58,7 @@ public:
nsVideoFrame(nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

View File

@ -53,6 +53,8 @@ NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) ViewportFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(ViewportFrame)
NS_IMETHODIMP
ViewportFrame::Init(nsIContent* aContent,
nsIFrame* aParent,

View File

@ -57,6 +57,8 @@
*/
class ViewportFrame : public nsContainerFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
typedef nsContainerFrame Super;
ViewportFrame(nsStyleContext* aContext)

View File

@ -64,7 +64,7 @@ enum eMathMLFrameType {
class nsIMathMLFrame
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsIMathMLFrame)
NS_DECL_QUERYFRAME_TARGET(nsIMathMLFrame)
/* SUPPORT FOR PRECISE POSITIONING */
/*====================================================================*/

View File

@ -69,6 +69,8 @@
// nsMathMLContainerFrame implementation
//
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLContainerFrame)
NS_QUERYFRAME_HEAD(nsMathMLContainerFrame)
NS_QUERYFRAME_ENTRY(nsMathMLFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
@ -1464,8 +1466,12 @@ NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
return it;
}
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmathBlockFrame)
nsIFrame*
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmathInlineFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmathInlineFrame)

View File

@ -72,6 +72,7 @@ public:
nsMathMLContainerFrame(nsStyleContext* aContext) : nsHTMLContainerFrame(aContext) {}
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// --------------------------------------------------------------------------
// Overloaded nsMathMLFrame methods -- see documentation in nsIMathMLFrame.h
@ -391,6 +392,8 @@ private:
// Issues: If/when mathml becomes a pluggable component, the separation will be needed.
class nsMathMLmathBlockFrame : public nsBlockFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext, PRUint32 aFlags);
@ -462,6 +465,8 @@ protected:
class nsMathMLmathInlineFrame : public nsInlineFrame {
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD

View File

@ -64,6 +64,8 @@ NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aConte
return new (aPresShell) nsMathMLForeignFrameWrapper(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLForeignFrameWrapper)
NS_IMETHODIMP
nsMathMLForeignFrameWrapper::Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,

View File

@ -53,6 +53,7 @@ public:
friend nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// Overloaded nsIMathMLFrame methods

View File

@ -53,6 +53,9 @@ NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLTokenFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLTokenFrame)
nsMathMLTokenFrame::~nsMathMLTokenFrame()
{
}

Some files were not shown because too many files have changed in this diff Show More