Bug 237291: Make Init() on svg-elements take a nodeinfo so that we only have one Init callchain. Not part of build.

r=afri a=tor
This commit is contained in:
sicking%bigfoot.com 2004-03-15 22:27:14 +00:00
Родитель e9a36fc934
Коммит 6ac7779482
17 изменённых файлов: 82 добавлений и 288 удалений

Просмотреть файл

@ -56,7 +56,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGCircleElement();
virtual ~nsSVGCircleElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
NS_DECL_ISUPPORTS_INHERITED
@ -87,21 +87,14 @@ nsresult NS_NewSVGCircleElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -135,10 +128,9 @@ nsSVGCircleElement::~nsSVGCircleElement()
nsresult
nsSVGCircleElement::Init()
nsSVGCircleElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGCircleElementBase::Init();
nsresult rv = nsSVGCircleElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -193,14 +185,7 @@ nsSVGCircleElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -92,9 +92,10 @@ NS_INTERFACE_MAP_END_INHERITING(nsGenericElement)
// Implementation
nsresult
nsSVGElement::Init()
nsSVGElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
nsresult rv = nsGenericElement::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv, rv);
// Create mapped properties:

Просмотреть файл

@ -63,7 +63,7 @@ protected:
nsSVGElement();
virtual ~nsSVGElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// nsISupports

Просмотреть файл

@ -57,7 +57,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGEllipseElement();
virtual ~nsSVGEllipseElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -91,21 +91,14 @@ nsresult NS_NewSVGEllipseElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -138,10 +131,9 @@ nsSVGEllipseElement::~nsSVGEllipseElement()
nsresult
nsSVGEllipseElement::Init()
nsSVGEllipseElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGEllipseElementBase::Init();
nsresult rv = nsSVGEllipseElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -212,14 +204,7 @@ nsSVGEllipseElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -56,7 +56,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGForeignObjectElement();
virtual ~nsSVGForeignObjectElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -89,21 +89,14 @@ nsresult NS_NewSVGForeignObjectElement(nsIContent **aResult, nsINodeInfo *aNodeI
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -136,10 +129,9 @@ nsSVGForeignObjectElement::~nsSVGForeignObjectElement()
nsresult
nsSVGForeignObjectElement::Init()
nsSVGForeignObjectElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGForeignObjectElementBase::Init();
nsresult rv = nsSVGForeignObjectElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -211,14 +203,7 @@ nsSVGForeignObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -50,7 +50,6 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGGElement();
virtual ~nsSVGGElement();
virtual nsresult Init();
public:
// interfaces:
@ -79,21 +78,14 @@ nsresult NS_NewSVGGElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -125,17 +117,6 @@ nsSVGGElement::~nsSVGGElement()
}
nsresult
nsSVGGElement::Init()
{
nsresult rv;
rv = nsSVGGElementBase::Init();
NS_ENSURE_SUCCESS(rv,rv);
return NS_OK;
}
//----------------------------------------------------------------------
// nsIDOMNode methods
@ -148,14 +129,7 @@ nsSVGGElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -64,10 +64,9 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGGraphicElementBase)
// Implementation
nsresult
nsSVGGraphicElement::Init()
nsSVGGraphicElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGGraphicElementBase::Init();
nsresult rv = nsSVGGraphicElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:

Просмотреть файл

@ -50,7 +50,7 @@ class nsSVGGraphicElement : public nsSVGGraphicElementBase,
public nsIDOMSVGTransformable // : nsIDOMSVGLocatable
{
protected:
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:

Просмотреть файл

@ -61,7 +61,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGImageElement();
virtual ~nsSVGImageElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -98,21 +98,14 @@ nsresult NS_NewSVGImageElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -146,10 +139,9 @@ nsSVGImageElement::~nsSVGImageElement()
nsresult
nsSVGImageElement::Init()
nsSVGImageElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGImageElementBase::Init();
nsresult rv = nsSVGImageElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -233,14 +225,7 @@ nsSVGImageElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -57,7 +57,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGLineElement();
virtual ~nsSVGLineElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -91,21 +91,14 @@ nsresult NS_NewSVGLineElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -138,10 +131,9 @@ nsSVGLineElement::~nsSVGLineElement()
nsresult
nsSVGLineElement::Init()
nsSVGLineElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGLineElementBase::Init();
nsresult rv = nsSVGLineElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -210,14 +202,7 @@ nsSVGLineElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -56,7 +56,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGPathElement();
virtual ~nsSVGPathElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -83,21 +83,14 @@ nsresult NS_NewSVGPathElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -131,10 +124,9 @@ nsSVGPathElement::~nsSVGPathElement()
nsresult
nsSVGPathElement::Init()
nsSVGPathElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGPathElementBase::Init();
nsresult rv = nsSVGPathElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -161,14 +153,7 @@ nsSVGPathElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -54,7 +54,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGPolygonElement();
virtual ~nsSVGPolygonElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -81,21 +81,14 @@ nsresult NS_NewSVGPolygonElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -129,10 +122,9 @@ nsSVGPolygonElement::~nsSVGPolygonElement()
nsresult
nsSVGPolygonElement::Init()
nsSVGPolygonElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGPolygonElementBase::Init();
nsresult rv = nsSVGPolygonElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -159,14 +151,7 @@ nsSVGPolygonElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -54,7 +54,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGPolylineElement();
virtual ~nsSVGPolylineElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -81,21 +81,14 @@ nsresult NS_NewSVGPolylineElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -129,10 +122,9 @@ nsSVGPolylineElement::~nsSVGPolylineElement()
nsresult
nsSVGPolylineElement::Init()
nsSVGPolylineElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGPolylineElementBase::Init();
nsresult rv = nsSVGPolylineElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -159,14 +151,7 @@ nsSVGPolylineElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -57,7 +57,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGRectElement();
virtual ~nsSVGRectElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -93,21 +93,14 @@ nsresult NS_NewSVGRectElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -140,10 +133,9 @@ nsSVGRectElement::~nsSVGRectElement()
nsresult
nsSVGRectElement::Init()
nsSVGRectElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGRectElementBase::Init();
nsresult rv = nsSVGRectElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -239,14 +231,7 @@ nsSVGRectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -74,7 +74,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGSVGElement();
virtual ~nsSVGSVGElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -125,21 +125,14 @@ nsresult NS_NewSVGSVGElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -181,10 +174,9 @@ nsSVGSVGElement::~nsSVGSVGElement()
nsresult
nsSVGSVGElement::Init()
nsSVGSVGElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGElement::Init();
nsresult rv = nsSVGElement::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// parent viewport. this will be initialized properly by our frame.
@ -346,14 +338,7 @@ nsSVGSVGElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -57,7 +57,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGTSpanElement();
virtual ~nsSVGTSpanElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -98,21 +98,14 @@ nsresult NS_NewSVGTSpanElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -147,10 +140,9 @@ nsSVGTSpanElement::~nsSVGTSpanElement()
nsresult
nsSVGTSpanElement::Init()
nsSVGTSpanElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGTSpanElementBase::Init();
nsresult rv = nsSVGTSpanElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -193,14 +185,7 @@ nsSVGTSpanElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();

Просмотреть файл

@ -61,7 +61,7 @@ protected:
nsINodeInfo *aNodeInfo);
nsSVGTextElement();
virtual ~nsSVGTextElement();
virtual nsresult Init();
nsresult Init(nsINodeInfo* aNodeInfo);
public:
// interfaces:
@ -104,21 +104,14 @@ nsresult NS_NewSVGTextElement(nsIContent **aResult, nsINodeInfo *aNodeInfo)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
*aResult = NS_STATIC_CAST(nsIContent *, it);
*aResult = it;
return NS_OK;
}
@ -153,10 +146,9 @@ nsSVGTextElement::~nsSVGTextElement()
nsresult
nsSVGTextElement::Init()
nsSVGTextElement::Init(nsINodeInfo* aNodeInfo)
{
nsresult rv;
rv = nsSVGTextElementBase::Init();
nsresult rv = nsSVGTextElementBase::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv,rv);
// Create mapped properties:
@ -199,14 +191,7 @@ nsSVGTextElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (!it) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = NS_STATIC_CAST(nsGenericElement*,it)->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();
return rv;
}
rv = it->Init();
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv)) {
it->Release();