Bug 388295 - Clean up nsSVGPathGeometryFrame: make constructor protected, put methods belonging to the same interface together. r+sr=tor
git-svn-id: svn://10.0.0.236/trunk@230740 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -222,18 +222,6 @@ NS_NewSVGPathGeometryFrame(nsIPresShell* aPresShell,
|
||||
return new (aPresShell) nsSVGPathGeometryFrame(aContext);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSVGPathGeometryFrame
|
||||
|
||||
nsSVGPathGeometryFrame::nsSVGPathGeometryFrame(nsStyleContext* aContext)
|
||||
: nsSVGPathGeometryFrameBase(aContext),
|
||||
mPropagateTransform(PR_TRUE)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// printf("nsSVGPathGeometryFrame %p CTOR\n", this);
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
@@ -289,43 +277,6 @@ nsSVGPathGeometryFrame::GetType() const
|
||||
return nsGkAtoms::svgPathGeometryFrame;
|
||||
}
|
||||
|
||||
nsSVGMarkerProperty *
|
||||
nsSVGPathGeometryFrame::GetMarkerProperty()
|
||||
{
|
||||
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS)
|
||||
return static_cast<nsSVGMarkerProperty *>
|
||||
(GetProperty(nsGkAtoms::marker));
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathGeometryFrame::UpdateMarkerProperty()
|
||||
{
|
||||
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS)
|
||||
return;
|
||||
|
||||
const nsStyleSVG *style = GetStyleSVG();
|
||||
|
||||
if ((style->mMarkerStart || style->mMarkerMid || style->mMarkerEnd) &&
|
||||
!new nsSVGMarkerProperty(style->mMarkerStart,
|
||||
style->mMarkerMid,
|
||||
style->mMarkerEnd,
|
||||
this)) {
|
||||
NS_ERROR("Could not create marker property");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathGeometryFrame::RemovePathProperties()
|
||||
{
|
||||
nsSVGUtils::StyleEffects(this);
|
||||
|
||||
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS)
|
||||
DeleteProperty(nsGkAtoms::marker);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGChildFrame methods
|
||||
|
||||
@@ -602,6 +553,43 @@ nsSVGPathGeometryFrame::GetCanvasTM(nsIDOMSVGMatrix * *aCTM)
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGPathGeometryFrame methods:
|
||||
|
||||
nsSVGMarkerProperty *
|
||||
nsSVGPathGeometryFrame::GetMarkerProperty()
|
||||
{
|
||||
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS)
|
||||
return static_cast<nsSVGMarkerProperty *>
|
||||
(GetProperty(nsGkAtoms::marker));
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathGeometryFrame::UpdateMarkerProperty()
|
||||
{
|
||||
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS)
|
||||
return;
|
||||
|
||||
const nsStyleSVG *style = GetStyleSVG();
|
||||
|
||||
if ((style->mMarkerStart || style->mMarkerMid || style->mMarkerEnd) &&
|
||||
!new nsSVGMarkerProperty(style->mMarkerStart,
|
||||
style->mMarkerMid,
|
||||
style->mMarkerEnd,
|
||||
this)) {
|
||||
NS_ERROR("Could not create marker property");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathGeometryFrame::RemovePathProperties()
|
||||
{
|
||||
nsSVGUtils::StyleEffects(this);
|
||||
|
||||
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS)
|
||||
DeleteProperty(nsGkAtoms::marker);
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGPathGeometryFrame::Render(nsSVGRenderState *aContext)
|
||||
{
|
||||
|
||||
@@ -59,14 +59,22 @@ typedef nsSVGGeometryFrame nsSVGPathGeometryFrameBase;
|
||||
class nsSVGPathGeometryFrame : public nsSVGPathGeometryFrameBase,
|
||||
public nsISVGChildFrame
|
||||
{
|
||||
public:
|
||||
nsSVGPathGeometryFrame(nsStyleContext* aContext);
|
||||
friend nsIFrame*
|
||||
NS_NewSVGPathGeometryFrame(nsIPresShell* aPresShell, nsIContent* aContent,
|
||||
nsStyleContext* aContext);
|
||||
protected:
|
||||
nsSVGPathGeometryFrame(nsStyleContext* aContext) :
|
||||
nsSVGPathGeometryFrameBase(aContext),
|
||||
mPropagateTransform(PR_TRUE) {}
|
||||
|
||||
// nsISupports interface:
|
||||
public:
|
||||
// nsISupports interface:
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
private:
|
||||
NS_IMETHOD_(nsrefcnt) AddRef() { return 1; }
|
||||
NS_IMETHOD_(nsrefcnt) Release() { return 1; }
|
||||
|
||||
public:
|
||||
// nsIFrame interface:
|
||||
virtual void Destroy();
|
||||
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
||||
|
||||
Reference in New Issue
Block a user