зеркало из https://github.com/mozilla/gecko-dev.git
Bug 380448 - simply SVG frame initialization. r=longsonr, sr=roc, a=vlad
This commit is contained in:
Родитель
18ccb0dcf0
Коммит
27877b11ea
|
@ -74,19 +74,6 @@ NS_GetSVGClipPathElement(nsIURI *aURI, nsIContent *aContent)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGClipPathFrame::InitSVG()
|
||||
{
|
||||
nsresult rv = nsSVGClipPathFrameBase::InitSVG();
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
mClipParentMatrix = NULL;
|
||||
mInUse = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGClipPathFrame::ClipPaint(nsSVGRenderState* aContext,
|
||||
nsISVGChildFrame* aParent,
|
||||
|
|
|
@ -46,9 +46,10 @@ class nsSVGClipPathFrame : public nsSVGClipPathFrameBase
|
|||
friend nsIFrame*
|
||||
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
||||
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
nsSVGClipPathFrame(nsStyleContext* aContext) : nsSVGClipPathFrameBase(aContext) {}
|
||||
nsSVGClipPathFrame(nsStyleContext* aContext) :
|
||||
nsSVGClipPathFrameBase(aContext),
|
||||
mClipParentMatrix(nsnull),
|
||||
mInUse(PR_FALSE) {}
|
||||
|
||||
public:
|
||||
// nsSVGClipPathFrame methods:
|
||||
|
|
|
@ -84,27 +84,23 @@ nsSVGContainerFrame::RemoveFrame(nsIAtom* aListName,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGContainerFrame::InitSVG()
|
||||
nsSVGContainerFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGContainerFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow);
|
||||
InitSVG();
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGDisplayContainerFrame::InitSVG()
|
||||
nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
AddStateBits(mParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
return NS_OK;
|
||||
AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -56,8 +56,6 @@ protected:
|
|||
return nsSVGContainerFrameBase::IsFrameOfType(aFlags & ~(nsIFrame::eSVG));
|
||||
}
|
||||
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
public:
|
||||
nsSVGContainerFrame(nsStyleContext* aContext) :
|
||||
nsSVGContainerFrameBase(aContext) {}
|
||||
|
@ -80,9 +78,6 @@ public:
|
|||
class nsSVGDisplayContainerFrame : public nsSVGContainerFrame,
|
||||
public nsISVGChildFrame
|
||||
{
|
||||
protected:
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
public:
|
||||
nsSVGDisplayContainerFrame(nsStyleContext* aContext) :
|
||||
nsSVGContainerFrame(aContext) {}
|
||||
|
@ -101,6 +96,9 @@ public:
|
|||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame);
|
||||
NS_IMETHOD Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
// nsISVGChildFrame interface:
|
||||
NS_IMETHOD PaintSVG(nsSVGRenderState* aContext, nsRect *aDirtyRect);
|
||||
|
|
|
@ -68,19 +68,6 @@ NS_GetSVGFilterElement(nsIURI *aURI, nsIContent *aContent)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGFilterFrame::InitSVG()
|
||||
{
|
||||
nsresult rv = nsSVGFilterFrameBase::InitSVG();
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIDOMSVGFilterElement> filter = do_QueryInterface(mContent);
|
||||
NS_ASSERTION(filter, "wrong content element");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGFilterFrame::FilterFailCleanup(nsSVGRenderState *aContext,
|
||||
nsISVGChildFrame *aTarget)
|
||||
|
|
|
@ -47,9 +47,6 @@ class nsSVGFilterFrame : public nsSVGFilterFrameBase
|
|||
friend nsIFrame*
|
||||
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
||||
|
||||
protected:
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
public:
|
||||
nsSVGFilterFrame(nsStyleContext* aContext) : nsSVGFilterFrameBase(aContext) {}
|
||||
|
||||
|
|
|
@ -60,30 +60,14 @@ nsSVGGeometryFrame::Destroy()
|
|||
nsSVGGeometryFrameBase::Destroy();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGGeometryFrame::InitSVG()
|
||||
{
|
||||
AddStateBits(mParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGGeometryFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
mContent = aContent;
|
||||
NS_IF_ADDREF(mContent);
|
||||
mParent = aParent;
|
||||
|
||||
if (mContent) {
|
||||
mContent->SetMayHaveFrame(PR_TRUE);
|
||||
}
|
||||
|
||||
InitSVG();
|
||||
DidSetStyleContext();
|
||||
|
||||
return NS_OK;
|
||||
AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
nsresult rv = nsSVGGeometryFrameBase::Init(aContent, aParent, aPrevInFlow);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -57,7 +57,6 @@ class nsSVGGeometryFrame : public nsSVGGeometryFrameBase,
|
|||
{
|
||||
protected:
|
||||
nsSVGGeometryFrame(nsStyleContext *aContext) : nsSVGGeometryFrameBase(aContext) {}
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
public:
|
||||
// nsIFrame interface:
|
||||
|
|
|
@ -82,7 +82,6 @@ class nsSVGImageFrame : public nsSVGPathGeometryFrame
|
|||
protected:
|
||||
nsSVGImageFrame(nsStyleContext* aContext) : nsSVGPathGeometryFrame(aContext) {}
|
||||
virtual ~nsSVGImageFrame();
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
public:
|
||||
// nsISVGChildFrame interface:
|
||||
|
@ -101,6 +100,9 @@ public:
|
|||
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType);
|
||||
NS_IMETHOD Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
|
@ -155,9 +157,11 @@ nsSVGImageFrame::~nsSVGImageFrame()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGImageFrame::InitSVG()
|
||||
nsSVGImageFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsSVGPathGeometryFrame::InitSVG();
|
||||
nsresult rv = nsSVGPathGeometryFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDOMSVGImageElement> Rect = do_QueryInterface(mContent);
|
||||
|
|
|
@ -63,21 +63,6 @@ NS_GetSVGMarkerElement(nsIURI *aURI, nsIContent *aContent)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGMarkerFrame::InitSVG()
|
||||
{
|
||||
nsresult rv = nsSVGMarkerFrameBase::InitSVG();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMSVGMarkerElement> marker = do_QueryInterface(mContent);
|
||||
NS_ASSERTION(marker, "wrong content element");
|
||||
|
||||
mMarkedFrame = nsnull;
|
||||
mInUse = mInUse2 = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGContainerFrame methods:
|
||||
|
||||
|
|
|
@ -53,10 +53,12 @@ protected:
|
|||
friend nsIFrame*
|
||||
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
||||
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
public:
|
||||
nsSVGMarkerFrame(nsStyleContext* aContext) : nsSVGMarkerFrameBase(aContext) {}
|
||||
nsSVGMarkerFrame(nsStyleContext* aContext) :
|
||||
nsSVGMarkerFrameBase(aContext),
|
||||
mMarkedFrame(nsnull),
|
||||
mInUse(PR_FALSE),
|
||||
mInUse2(PR_FALSE) {}
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
|
|
|
@ -65,23 +65,6 @@ NS_GetSVGMaskElement(nsIURI *aURI, nsIContent *aContent)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGMaskFrame::InitSVG()
|
||||
{
|
||||
nsresult rv = nsSVGMaskFrameBase::InitSVG();
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
mMaskParentMatrix = nsnull;
|
||||
mInUse = PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMSVGMaskElement> mask = do_QueryInterface(mContent);
|
||||
NS_ASSERTION(mask, "wrong content element");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
already_AddRefed<gfxPattern>
|
||||
nsSVGMaskFrame::ComputeMaskAlpha(nsSVGRenderState *aContext,
|
||||
nsISVGChildFrame* aParent,
|
||||
|
|
|
@ -49,9 +49,10 @@ class nsSVGMaskFrame : public nsSVGMaskFrameBase
|
|||
friend nsIFrame*
|
||||
NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
||||
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
nsSVGMaskFrame(nsStyleContext* aContext) : nsSVGMaskFrameBase(aContext) {}
|
||||
nsSVGMaskFrame(nsStyleContext* aContext) :
|
||||
nsSVGMaskFrameBase(aContext),
|
||||
mMaskParentMatrix(nsnull),
|
||||
mInUse(PR_FALSE) {}
|
||||
|
||||
public:
|
||||
// nsSVGMaskFrame method:
|
||||
|
|
|
@ -153,8 +153,12 @@ nsSVGOuterSVGFrame::nsSVGOuterSVGFrame(nsStyleContext* aContext)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGOuterSVGFrame::InitSVG()
|
||||
nsSVGOuterSVGFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsSVGOuterSVGFrameBase::Init(aContent, aParent, aPrevInFlow);
|
||||
|
||||
nsIDocument* doc = mContent->GetCurrentDoc();
|
||||
if (doc) {
|
||||
// we only care about our content's zoom and pan values if it's the root element
|
||||
|
@ -173,7 +177,7 @@ nsSVGOuterSVGFrame::InitSVG()
|
|||
|
||||
AddStateBits(NS_STATE_IS_OUTER_SVG);
|
||||
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -56,7 +56,6 @@ class nsSVGOuterSVGFrame : public nsSVGOuterSVGFrameBase,
|
|||
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
||||
protected:
|
||||
nsSVGOuterSVGFrame(nsStyleContext* aContext);
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
// nsISupports interface:
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
@ -88,6 +87,10 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists);
|
||||
|
||||
NS_IMETHOD Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче