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 class nsIPercentHeightObserver
{ {
public: 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 // Notify the observer that aReflowState has no computed height, but it has a percent height
virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) = 0; virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -48,9 +48,11 @@ class nsGfxCheckboxControlFrame : public nsFormControlFrame,
public nsICheckboxControlFrame public nsICheckboxControlFrame
{ {
public: public:
NS_DECL_FRAMEARENA_HELPERS
nsGfxCheckboxControlFrame(nsStyleContext* aContext); nsGfxCheckboxControlFrame(nsStyleContext* aContext);
virtual ~nsGfxCheckboxControlFrame(); virtual ~nsGfxCheckboxControlFrame();
#ifdef DEBUG #ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const { NS_IMETHOD GetFrameName(nsAString& aResult) const {
return MakeFrameName(NS_LITERAL_STRING("CheckboxControl"), aResult); return MakeFrameName(NS_LITERAL_STRING("CheckboxControl"), aResult);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -288,30 +288,6 @@ NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsFrame(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) nsFrame::nsFrame(nsStyleContext* aContext)
{ {
MOZ_COUNT_CTOR(nsFrame); MOZ_COUNT_CTOR(nsFrame);
@ -330,9 +306,19 @@ nsFrame::~nsFrame()
mStyleContext->Release(); 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_HEAD(nsFrame)
NS_QUERYFRAME_ENTRY(nsIFrame) NS_QUERYFRAME_ENTRY(nsIFrame)
NS_QUERYFRAME_TAIL NS_QUERYFRAME_TAIL_INHERITANCE_ROOT
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// nsIFrame // nsIFrame
@ -470,14 +456,20 @@ nsFrame::Destroy()
view->Destroy(); view->Destroy();
} }
// Deleting the frame doesn't really free the memory, since we're using an // Must retrieve the object size before calling destructors, so the
// arena for allocation, but we will get our destructors called. // vtable is still valid.
delete this; //
// 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 size_t sz = GetAllocatedSize();
// recycler. this->~nsFrame();
size_t* sz = (size_t*)this;
shell->FreeFrame(*sz, 0 /* dummy */, (void*)this); // 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 NS_IMETHODIMP

View File

@ -110,6 +110,22 @@
#define NS_FRAME_TRACE_REFLOW_OUT(_method, _status) #define NS_FRAME_TRACE_REFLOW_OUT(_method, _status)
#endif #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; struct nsBoxLayoutMetrics;
@ -131,10 +147,6 @@ public:
friend nsIFrame* NS_NewEmptyFrame(nsIPresShell* aShell, friend nsIFrame* NS_NewEmptyFrame(nsIPresShell* aShell,
nsStyleContext* aContext); 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: private:
// Left undefined; nsFrame objects are never allocated from the heap. // Left undefined; nsFrame objects are never allocated from the heap.
void* operator new(size_t sz) CPP_THROW_NEW; void* operator new(size_t sz) CPP_THROW_NEW;
@ -156,6 +168,7 @@ public:
// nsQueryFrame // nsQueryFrame
NS_DECL_QUERYFRAME NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame // nsIFrame
NS_IMETHOD Init(nsIContent* aContent, NS_IMETHOD Init(nsIContent* aContent,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@
class nsICanvasFrame class nsICanvasFrame
{ {
public: public:
NS_DECLARE_FRAME_ACCESSOR(nsICanvasFrame) NS_DECL_QUERYFRAME_TARGET(nsICanvasFrame)
/** SetHasFocus tells the CanvasFrame to draw with focus ring /** SetHasFocus tells the CanvasFrame to draw with focus ring
* @param aHasFocus PR_TRUE to show focus ring, PR_FALSE to hide it * @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 class nsIFrame : public nsQueryFrame
{ {
public: public:
NS_DECLARE_FRAME_ACCESSOR(nsIFrame) NS_DECL_QUERYFRAME_TARGET(nsIFrame)
nsPresContext* PresContext() const { nsPresContext* PresContext() const {
return GetStyleContext()->GetRuleNode()->GetPresContext(); return GetStyleContext()->GetRuleNode()->GetPresContext();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@ class nsPresState;
class nsIStatefulFrame class nsIStatefulFrame
{ {
public: public:
NS_DECLARE_FRAME_ACCESSOR(nsIStatefulFrame) NS_DECL_QUERYFRAME_TARGET(nsIStatefulFrame)
// If you create a special type stateful frame (e.g. scroll) that needs // 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 // 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); return new (aPresShell) nsImageFrame(aContext);
} }
NS_IMPL_FRAMEARENA_HELPERS(nsImageFrame)
nsImageFrame::nsImageFrame(nsStyleContext* aContext) : nsImageFrame::nsImageFrame(nsStyleContext* aContext) :
ImageFrameSuper(aContext), ImageFrameSuper(aContext),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -46,6 +46,8 @@ class nsSharedPageData;
class nsPageFrame : public nsContainerFrame { class nsPageFrame : public nsContainerFrame {
public: public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD Reflow(nsPresContext* aPresContext, 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(nsStyleContext* aContext);
~nsPageBreakFrame(); ~nsPageBreakFrame();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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