Bug 734656 - Make the NS_STATE_SVG_NONDISPLAY_CHILD classes easier to find. r=longsonr.

--HG--
extra : rebase_source : a3f882a4b0f8df3347288dff25c3bbb7be72332b
This commit is contained in:
Jonathan Watt 2012-03-10 19:28:06 +00:00
parent d5c1731cfc
commit c4c53eae33
7 changed files with 37 additions and 29 deletions

View File

@ -49,9 +49,12 @@ class nsSVGClipPathFrame : public nsSVGClipPathFrameBase
friend nsIFrame*
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
protected:
nsSVGClipPathFrame(nsStyleContext* aContext) :
nsSVGClipPathFrameBase(aContext),
mInUse(false) {}
nsSVGClipPathFrame(nsStyleContext* aContext)
: nsSVGClipPathFrameBase(aContext)
, mInUse(false)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
NS_DECL_FRAMEARENA_HELPERS

View File

@ -51,7 +51,12 @@ nsIFrame*
NS_NewSVGContainerFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
return new (aPresShell) nsSVGContainerFrame(aContext);
nsIFrame *frame = new (aPresShell) nsSVGContainerFrame(aContext);
// If we were called directly, then the frame is for a <defs> or
// an unknown element type. In both cases we prevent the content
// from displaying directly.
frame->AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
return frame;
}
NS_IMPL_FRAMEARENA_HELPERS(nsSVGContainerFrame)
@ -88,16 +93,6 @@ nsSVGContainerFrame::RemoveFrame(ChildListID aListID,
return NS_OK;
}
NS_IMETHODIMP
nsSVGContainerFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow);
return rv;
}
NS_IMETHODIMP
nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
@ -108,7 +103,7 @@ nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD |
NS_STATE_SVG_REDRAW_SUSPENDED));
}
nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow);
nsresult rv = nsSVGContainerFrame::Init(aContent, aParent, aPrevInFlow);
return rv;
}

View File

@ -71,9 +71,6 @@ public:
nsFrameList& aFrameList);
NS_IMETHOD RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame);
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
virtual bool IsFrameOfType(PRUint32 aFlags) const
{

View File

@ -49,7 +49,11 @@ class nsSVGFilterFrame : public nsSVGFilterFrameBase
friend nsIFrame*
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
protected:
nsSVGFilterFrame(nsStyleContext* aContext) : nsSVGFilterFrameBase(aContext) {}
nsSVGFilterFrame(nsStyleContext* aContext)
: nsSVGFilterFrameBase(aContext)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
NS_DECL_FRAMEARENA_HELPERS

View File

@ -54,11 +54,14 @@ class nsSVGMarkerFrame : public nsSVGMarkerFrameBase
friend nsIFrame*
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
protected:
nsSVGMarkerFrame(nsStyleContext* aContext) :
nsSVGMarkerFrameBase(aContext),
mMarkedFrame(nsnull),
mInUse(false),
mInUse2(false) {}
nsSVGMarkerFrame(nsStyleContext* aContext)
: nsSVGMarkerFrameBase(aContext)
, mMarkedFrame(nsnull)
, mInUse(false)
, mInUse2(false)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
NS_DECL_FRAMEARENA_HELPERS

View File

@ -51,9 +51,12 @@ class nsSVGMaskFrame : public nsSVGMaskFrameBase
friend nsIFrame*
NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
protected:
nsSVGMaskFrame(nsStyleContext* aContext) :
nsSVGMaskFrameBase(aContext),
mInUse(false) {}
nsSVGMaskFrame(nsStyleContext* aContext)
: nsSVGMaskFrameBase(aContext)
, mInUse(false)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
NS_DECL_FRAMEARENA_HELPERS

View File

@ -47,8 +47,11 @@ typedef nsSVGContainerFrame nsSVGPaintServerFrameBase;
class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase
{
protected:
nsSVGPaintServerFrame(nsStyleContext* aContext) :
nsSVGPaintServerFrameBase(aContext) {}
nsSVGPaintServerFrame(nsStyleContext* aContext)
: nsSVGPaintServerFrameBase(aContext)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
NS_DECL_FRAMEARENA_HELPERS