Bug 313817. DeCOMtaminate SVG and MathML NS_New*Frame functions. r+sr=roc, patch by Marc Liddell.

This commit is contained in:
roc+%cs.cmu.edu 2005-11-11 02:36:29 +00:00
Родитель 7f395d7734
Коммит 28cfb5adfc
80 изменённых файлов: 437 добавлений и 882 удалений

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

@ -152,13 +152,13 @@ static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
#include "nsIXTFElement.h"
#include "nsIXTFElementWrapperPrivate.h"
#include "nsIXTFVisualWrapperPrivate.h"
nsresult
NS_NewXTFXULDisplayFrame(nsIPresShell*, nsIFrame**);
nsresult
NS_NewXTFXMLDisplayFrame(nsIPresShell*, PRBool isBlock, nsIFrame**);
nsIFrame*
NS_NewXTFXULDisplayFrame(nsIPresShell*);
nsIFrame*
NS_NewXTFXMLDisplayFrame(nsIPresShell*, PRBool isBlock);
#ifdef MOZ_SVG
nsresult
NS_NewXTFSVGDisplayFrame(nsIPresShell*, nsIContent*, nsIFrame**);
nsIFrame*
NS_NewXTFSVGDisplayFrame(nsIPresShell*, nsIContent*);
#endif
#endif
@ -172,62 +172,62 @@ NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell);
#include "nsStyleUtil.h"
#include "nsSVGUtils.h"
nsresult
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGPolylineFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGPolygonFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGCircleFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGEllipseFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGLineFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGRectFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsIFrame*
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGPolylineFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGPolygonFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGCircleFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGEllipseFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGLineFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGRectFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent);
#ifdef MOZ_SVG_FOREIGNOBJECT
nsresult
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsIFrame*
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent);
#endif
nsresult
NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGTSpanFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGDefsFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsIFrame*
NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent);
nsIFrame*
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGTSpanFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent);
nsIFrame*
NS_NewSVGDefsFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsIContent* aContent);
PRBool
NS_SVG_TestFeatures (const nsAString& value);
extern nsresult
NS_NewSVGLinearGradientFrame(nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame** newFrame);
extern nsresult
NS_NewSVGRadialGradientFrame(nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame** newFrame);
extern nsresult
NS_NewSVGStopFrame(nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame *aParentFrame, nsIFrame** newFrame);
nsresult
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
extern nsresult
NS_NewSVGImageFrame(nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame** newFrame);
nsresult
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGTextPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGFilterFrame(nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame** newFrame);
nsresult
NS_NewSVGPatternFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
extern nsIFrame*
NS_NewSVGLinearGradientFrame(nsIPresShell *aPresShell, nsIContent *aContent);
extern nsIFrame*
NS_NewSVGRadialGradientFrame(nsIPresShell *aPresShell, nsIContent *aContent);
extern nsIFrame*
NS_NewSVGStopFrame(nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame *aParentFrame);
nsIFrame*
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsIContent* aContent);
extern nsIFrame*
NS_NewSVGImageFrame(nsIPresShell *aPresShell, nsIContent *aContent);
nsIFrame*
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsIContent* aContent);
nsIFrame*
NS_NewSVGTextPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent);
nsIFrame*
NS_NewSVGFilterFrame(nsIPresShell *aPresShell, nsIContent *aContent);
nsIFrame*
NS_NewSVGPatternFrame(nsIPresShell* aPresShell, nsIContent* aContent);
#endif
#include "nsIDocument.h"
@ -4606,9 +4606,9 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState,
#ifdef MOZ_SVG
if (aDocElement->GetNameSpaceID() == kNameSpaceID_SVG &&
nsSVGUtils::SVGEnabled()) {
rv = NS_NewSVGOuterSVGFrame(mPresShell, aDocElement, &contentFrame);
if (NS_FAILED(rv)) {
return rv;
contentFrame = NS_NewSVGOuterSVGFrame(mPresShell, aDocElement);
if (!contentFrame) {
return NS_ERROR_FAILURE;
}
}
else
@ -5440,7 +5440,7 @@ nsCSSFrameConstructor::ConstructTextFrame(nsFrameConstructorState& aState,
nsCOMPtr<nsISVGTextContainerFrame> svg_parent = do_QueryInterface(aParentFrame);
if (svg_parent)
{
NS_NewSVGGlyphFrame(mPresShell, aContent, aParentFrame, &newFrame);
newFrame = NS_NewSVGGlyphFrame(mPresShell, aContent, aParentFrame);
}
else {
newFrame = NS_NewTextFrame(mPresShell);
@ -7104,46 +7104,46 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
aTag == nsMathMLAtoms::mn_ ||
aTag == nsMathMLAtoms::ms_ ||
aTag == nsMathMLAtoms::mtext_)
rv = NS_NewMathMLTokenFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLTokenFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mo_)
rv = NS_NewMathMLmoFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmoFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mfrac_)
rv = NS_NewMathMLmfracFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmfracFrame(mPresShell);
else if (aTag == nsMathMLAtoms::msup_)
rv = NS_NewMathMLmsupFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmsupFrame(mPresShell);
else if (aTag == nsMathMLAtoms::msub_)
rv = NS_NewMathMLmsubFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmsubFrame(mPresShell);
else if (aTag == nsMathMLAtoms::msubsup_)
rv = NS_NewMathMLmsubsupFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmsubsupFrame(mPresShell);
else if (aTag == nsMathMLAtoms::munder_)
rv = NS_NewMathMLmunderFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmunderFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mover_)
rv = NS_NewMathMLmoverFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmoverFrame(mPresShell);
else if (aTag == nsMathMLAtoms::munderover_)
rv = NS_NewMathMLmunderoverFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmunderoverFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mphantom_)
rv = NS_NewMathMLmphantomFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmphantomFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mpadded_)
rv = NS_NewMathMLmpaddedFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmpaddedFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mspace_)
rv = NS_NewMathMLmspaceFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmspaceFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mfenced_)
rv = NS_NewMathMLmfencedFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmfencedFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mmultiscripts_)
rv = NS_NewMathMLmmultiscriptsFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmmultiscriptsFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mstyle_)
rv = NS_NewMathMLmstyleFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmstyleFrame(mPresShell);
else if (aTag == nsMathMLAtoms::msqrt_)
rv = NS_NewMathMLmsqrtFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmsqrtFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mroot_)
rv = NS_NewMathMLmrootFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmrootFrame(mPresShell);
else if (aTag == nsMathMLAtoms::maction_)
rv = NS_NewMathMLmactionFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmactionFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mrow_ ||
aTag == nsMathMLAtoms::merror_ ||
aTag == nsMathMLAtoms::none_ ||
aTag == nsMathMLAtoms::mprescripts_ )
rv = NS_NewMathMLmrowFrame(mPresShell, &newFrame);
newFrame = NS_NewMathMLmrowFrame(mPresShell);
// CONSTRUCTION of MTABLE elements
else if (aTag == nsMathMLAtoms::mtable_ &&
disp->mDisplay == NS_STYLE_DISPLAY_TABLE) {
@ -7156,8 +7156,10 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
nsStyleSet *styleSet = mPresShell->StyleSet();
// first, create a MathML mrow frame that will wrap the block frame
rv = NS_NewMathMLmrowFrame(mPresShell, &newFrame);
if (NS_FAILED(rv)) return rv;
newFrame = NS_NewMathMLmrowFrame(mPresShell);
if (NS_UNLIKELY(!newFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsRefPtr<nsStyleContext> mrowContext;
mrowContext = styleSet->ResolvePseudoStyleFor(aContent,
nsCSSAnonBoxes::mozMathInline,
@ -7211,15 +7213,15 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
// root <math> element
const nsStyleDisplay* display = aStyleContext->GetStyleDisplay();
PRBool isBlock = (NS_STYLE_DISPLAY_BLOCK == display->mDisplay);
rv = NS_NewMathMLmathFrame(mPresShell, &newFrame, isBlock);
newFrame = NS_NewMathMLmathFrame(mPresShell, isBlock);
}
else {
return rv;
return NS_OK;
}
// If we succeeded in creating a frame then initialize it, process its
// children (if requested), and set the initial child list
if (NS_SUCCEEDED(rv) && newFrame) {
if (newFrame) {
// If the frame is a replaced element, then set the frame state bit
if (isReplaced) {
newFrame->AddStateBits(NS_FRAME_REPLACED_ELEMENT);
@ -7254,9 +7256,11 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
rv = CreateInsertionPointChildren(aState, newFrame, aContent);
return CreateInsertionPointChildren(aState, newFrame, aContent);
}
else {
return NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
#endif // MOZ_MATHML
@ -7296,7 +7300,7 @@ nsCSSFrameConstructor::ConstructXTFFrame(nsFrameConstructorState& aState,
switch(xtfElem->GetElementType()) {
case nsIXTFElement::ELEMENT_TYPE_SVG_VISUAL:
#ifdef MOZ_SVG
rv = NS_NewXTFSVGDisplayFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewXTFSVGDisplayFrame(mPresShell, aContent);
#else
NS_ERROR("xtf svg visuals are only supported in mozilla builds with native svg");
#endif
@ -7304,11 +7308,11 @@ nsCSSFrameConstructor::ConstructXTFFrame(nsFrameConstructorState& aState,
case nsIXTFElement::ELEMENT_TYPE_XML_VISUAL:
{
PRBool isBlock = (NS_STYLE_DISPLAY_BLOCK == disp->mDisplay);
rv = NS_NewXTFXMLDisplayFrame(mPresShell, isBlock, &newFrame);
newFrame = NS_NewXTFXMLDisplayFrame(mPresShell, isBlock);
}
break;
case nsIXTFElement::ELEMENT_TYPE_XUL_VISUAL:
rv = NS_NewXTFXULDisplayFrame(mPresShell, &newFrame);
newFrame = NS_NewXTFXULDisplayFrame(mPresShell);
break;
case nsIXTFElement::ELEMENT_TYPE_GENERIC_ELEMENT:
NS_ERROR("huh? ELEMENT_TYPE_GENERIC_ELEMENT should have been flagged by caller");
@ -7320,7 +7324,7 @@ nsCSSFrameConstructor::ConstructXTFFrame(nsFrameConstructorState& aState,
// If we succeeded in creating a frame then initialize it, process its
// children (if requested), and set the initial child list
if (NS_SUCCEEDED(rv) && newFrame != nsnull) {
if (newFrame) {
InitAndRestoreFrame(aState, aContent,
aState.GetGeometricParent(disp, aParentFrame),
aStyleContext, nsnull, newFrame);
@ -7364,9 +7368,11 @@ nsCSSFrameConstructor::ConstructXTFFrame(nsFrameConstructorState& aState,
// Note: we don't worry about insertionFrame here because we know
// that XTF elements always insert into the primary frame of their
// insertion content.
rv = CreateInsertionPointChildren(aState, newFrame, aContent, PR_FALSE);
return CreateInsertionPointChildren(aState, newFrame, aContent, PR_FALSE);
}
else {
return NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
#endif // MOZ_XTF
@ -7582,73 +7588,73 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
geometricParent = aState.GetGeometricParent(disp, aParentFrame);
forceView = PR_TRUE;
rv = NS_NewSVGOuterSVGFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGOuterSVGFrame(mPresShell, aContent);
}
else {
// This is an inner <svg> element
rv = NS_NewSVGInnerSVGFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGInnerSVGFrame(mPresShell, aContent);
}
}
else if (aTag == nsSVGAtoms::g) {
rv = NS_NewSVGGFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGGFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::polygon)
rv = NS_NewSVGPolygonFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGPolygonFrame(mPresShell, aContent);
else if (aTag == nsSVGAtoms::polyline)
rv = NS_NewSVGPolylineFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGPolylineFrame(mPresShell, aContent);
else if (aTag == nsSVGAtoms::circle)
rv = NS_NewSVGCircleFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGCircleFrame(mPresShell, aContent);
else if (aTag == nsSVGAtoms::defs) {
rv = NS_NewSVGDefsFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGDefsFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::ellipse)
rv = NS_NewSVGEllipseFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGEllipseFrame(mPresShell, aContent);
else if (aTag == nsSVGAtoms::line)
rv = NS_NewSVGLineFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGLineFrame(mPresShell, aContent);
else if (aTag == nsSVGAtoms::rect)
rv = NS_NewSVGRectFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGRectFrame(mPresShell, aContent);
#ifdef MOZ_SVG_FOREIGNOBJECT
else if (aTag == nsSVGAtoms::foreignObject) {
rv = NS_NewSVGForeignObjectFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGForeignObjectFrame(mPresShell, aContent);
}
#endif
else if (aTag == nsSVGAtoms::path)
rv = NS_NewSVGPathFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGPathFrame(mPresShell, aContent);
else if (aTag == nsSVGAtoms::text) {
rv = NS_NewSVGTextFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGTextFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::tspan) {
rv = NS_NewSVGTSpanFrame(mPresShell, aContent, aParentFrame, &newFrame);
newFrame = NS_NewSVGTSpanFrame(mPresShell, aContent, aParentFrame);
}
else if (aTag == nsSVGAtoms::linearGradient) {
rv = NS_NewSVGLinearGradientFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGLinearGradientFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::radialGradient) {
rv = NS_NewSVGRadialGradientFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGRadialGradientFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::stop) {
rv = NS_NewSVGStopFrame(mPresShell, aContent, aParentFrame, &newFrame);
newFrame = NS_NewSVGStopFrame(mPresShell, aContent, aParentFrame);
}
else if (aTag == nsSVGAtoms::use) {
rv = NS_NewSVGUseFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGUseFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::marker) {
rv = NS_NewSVGMarkerFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGMarkerFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::image) {
rv = NS_NewSVGImageFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGImageFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::clipPath) {
rv = NS_NewSVGClipPathFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGClipPathFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::textPath) {
rv = NS_NewSVGTextPathFrame(mPresShell, aContent, aParentFrame, &newFrame);
newFrame = NS_NewSVGTextPathFrame(mPresShell, aContent, aParentFrame);
}
else if (aTag == nsSVGAtoms::filter) {
rv = NS_NewSVGFilterFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGFilterFrame(mPresShell, aContent);
}
else if (aTag == nsSVGAtoms::pattern) {
rv = NS_NewSVGPatternFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGPatternFrame(mPresShell, aContent);
}
if (newFrame == nsnull) {
@ -7667,11 +7673,11 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
// aTag->ToString(str);
// printf("%s>\n", NS_ConvertUCS2toUTF8(str).get());
#endif
rv = NS_NewSVGGenericContainerFrame(mPresShell, aContent, &newFrame);
newFrame = NS_NewSVGGenericContainerFrame(mPresShell, aContent);
}
// If we succeeded in creating a frame then initialize it, process its
// children (if requested), and set the initial child list
if (NS_SUCCEEDED(rv) && newFrame != nsnull) {
if (newFrame != nsnull) {
#ifdef MOZ_SVG_FOREIGNOBJECT
if (aTag == nsSVGAtoms::foreignObject) {
// Claim to be relatively positioned so that we end up being the
@ -7719,8 +7725,12 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
if (!newFrame->IsLeaf())
rv = CreateInsertionPointChildren(aState, newFrame, aContent);
return rv;
}
else {
return NS_ERROR_FAILURE;
}
return rv;
}
#endif // MOZ_SVG

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

@ -716,16 +716,16 @@ nsMathMLContainerFrame::WrapForeignFrames()
child->QueryInterface(kInlineFrameCID, (void**)&inlineFrame);
if (inlineFrame) {
// create a new wrapper frame to wrap this child
nsIFrame* wrapper;
nsresult rv = NS_NewMathMLForeignFrameWrapper(presContext->PresShell(),
&wrapper);
if (NS_FAILED(rv)) return rv;
nsIFrame* wrapper = NS_NewMathMLForeignFrameWrapper(presContext->PresShell());
if (NS_UNLIKELY(!wrapper)) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsRefPtr<nsStyleContext> newStyleContext;
newStyleContext = presContext->StyleSet()->
ResolvePseudoStyleFor(mContent,
nsCSSAnonBoxes::mozAnonymousBlock,
mStyleContext);
rv = wrapper->Init(presContext, mContent, this, newStyleContext, nsnull);
nsresult rv = wrapper->Init(presContext, mContent, this, newStyleContext, nsnull);
if (NS_FAILED(rv)) {
wrapper->Destroy(presContext);
return rv;
@ -1494,34 +1494,16 @@ nsMathMLContainerFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
//==========================
nsresult
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmathBlockFrame* it = new (aPresShell) nsMathMLmathBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmathBlockFrame;
}
//==========================
nsresult
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmathInlineFrame* it = new (aPresShell) nsMathMLmathInlineFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmathInlineFrame;
}

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

@ -329,7 +329,7 @@ protected:
// Issues: If/when mathml becomes a pluggable component, the separation will be needed.
class nsMathMLmathBlockFrame : public nsBlockFrame {
public:
friend nsresult NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell);
// beware, mFrames is not set by nsBlockFrame
// cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames
@ -418,7 +418,7 @@ protected:
class nsMathMLmathInlineFrame : public nsInlineFrame {
public:
friend nsresult NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell);
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,

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

@ -59,19 +59,10 @@ NS_IMPL_ADDREF_INHERITED(nsMathMLForeignFrameWrapper, nsMathMLFrame)
NS_IMPL_RELEASE_INHERITED(nsMathMLForeignFrameWrapper, nsMathMLFrame)
NS_IMPL_QUERY_INTERFACE_INHERITED1(nsMathMLForeignFrameWrapper, nsBlockFrame, nsMathMLFrame)
nsresult
NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLForeignFrameWrapper* it = new (aPresShell) nsMathMLForeignFrameWrapper;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLForeignFrameWrapper;
}
NS_IMETHODIMP

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

@ -49,7 +49,7 @@
class nsMathMLForeignFrameWrapper : public nsBlockFrame,
public nsMathMLFrame {
public:
friend nsresult NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell);
NS_DECL_ISUPPORTS_INHERITED

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

@ -42,77 +42,46 @@
#include "nsISupports.h"
// Factory methods for creating MathML objects
nsresult
NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell,
nsIFrame** aNewFrame);
nsresult
NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmsFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmfracFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmsubFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmsupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmunderFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmfracFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsubFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsupFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmunderFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell);
nsIFrame*
NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell);
inline nsIFrame*
NS_NewMathMLmtableFrame(nsIPresShell* aPresShell)
nsIFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell);
inline nsIFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell)
{
return NS_NewTableFrame(aPresShell);
}
inline nsIFrame*
NS_NewMathMLmtrFrame(nsIPresShell* aPresShell)
inline nsIFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell)
{
return NS_NewTableRowFrame(aPresShell);
}
nsIFrame*
NS_NewMathMLmtdFrame(nsIPresShell* aPresShell);
nsIFrame*
NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell);
nsresult
NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmrootFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell);
nsresult
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
inline nsresult
NS_NewMathMLmathFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
PRBool aIsBlock)
nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell);
inline nsIFrame* NS_NewMathMLmathFrame(nsIPresShell* aPresShell, PRBool aIsBlock)
{
return (aIsBlock)
? NS_NewMathMLmathBlockFrame(aPresShell, aNewFrame)
: NS_NewMathMLmathInlineFrame(aPresShell, aNewFrame);
? NS_NewMathMLmathBlockFrame(aPresShell)
: NS_NewMathMLmathInlineFrame(aPresShell);
}
#endif /* nsMathMLParts_h___ */

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

@ -54,19 +54,10 @@
#include "nsMathMLTokenFrame.h"
nsresult
NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLTokenFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLTokenFrame* it = new (aPresShell) nsMathMLTokenFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLTokenFrame;
}
nsMathMLTokenFrame::nsMathMLTokenFrame()

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

@ -47,7 +47,7 @@
class nsMathMLTokenFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell);
virtual nsIAtom* GetType() const;

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

@ -76,19 +76,10 @@ NS_IMPL_ADDREF_INHERITED(nsMathMLmactionFrame, nsMathMLContainerFrame)
NS_IMPL_RELEASE_INHERITED(nsMathMLmactionFrame, nsMathMLContainerFrame)
NS_IMPL_QUERY_INTERFACE_INHERITED1(nsMathMLmactionFrame, nsMathMLContainerFrame, nsIDOMMouseListener)
nsresult
NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmactionFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmactionFrame* it = new (aPresShell) nsMathMLmactionFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmactionFrame;
}
nsMathMLmactionFrame::nsMathMLmactionFrame()

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

@ -56,7 +56,7 @@
class nsMathMLmactionFrame : public nsMathMLContainerFrame,
public nsIDOMMouseListener {
public:
friend nsresult NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell);
NS_DECL_ISUPPORTS_INHERITED

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

@ -53,19 +53,10 @@
// <mfenced> -- surround content with a pair of fences
//
nsresult
NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmfencedFrame* it = new (aPresShell) nsMathMLmfencedFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmfencedFrame;
}
nsMathMLmfencedFrame::nsMathMLmfencedFrame()

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

@ -48,7 +48,7 @@
class nsMathMLmfencedFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell);
virtual void
SetAdditionalStyleContext(PRInt32 aIndex,

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

@ -70,19 +70,10 @@
static const PRUnichar kSlashChar = PRUnichar('/');
nsresult
NS_NewMathMLmfracFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmfracFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmfracFrame* it = new (aPresShell) nsMathMLmfracFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmfracFrame;
}
nsMathMLmfracFrame::nsMathMLmfracFrame()

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

@ -85,7 +85,7 @@ element.
class nsMathMLmfracFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmfracFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmfracFrame(nsIPresShell* aPresShell);
virtual void
SetAdditionalStyleContext(PRInt32 aIndex,

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

@ -53,19 +53,10 @@
// <mmultiscripts> -- attach prescripts and tensor indices to a base - implementation
//
nsresult
NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmmultiscriptsFrame* it = new (aPresShell) nsMathMLmmultiscriptsFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmmultiscriptsFrame;
}
nsMathMLmmultiscriptsFrame::nsMathMLmmultiscriptsFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmmultiscriptsFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell);
NS_IMETHOD
TransmitAutomaticData();

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

@ -58,19 +58,10 @@
// additional style context to be used by our MathMLChar.
#define NS_MATHML_CHAR_STYLE_CONTEXT_INDEX 0
nsresult
NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmoFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmoFrame* it = new (aPresShell) nsMathMLmoFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmoFrame;
}
nsMathMLmoFrame::nsMathMLmoFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmoFrame : public nsMathMLTokenFrame {
public:
friend nsresult NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell);
virtual nsIAtom* GetType() const;

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

@ -56,19 +56,10 @@
// <mover> -- attach an overscript to a base - implementation
//
nsresult
NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmoverFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmoverFrame* it = new (aPresShell) nsMathMLmoverFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmoverFrame;
}
nsMathMLmoverFrame::nsMathMLmoverFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmoverFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell);
NS_IMETHOD
Place(nsIRenderingContext& aRenderingContext,

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

@ -66,19 +66,10 @@
#define NS_MATHML_PSEUDO_UNIT_LSPACE 5
#define NS_MATHML_PSEUDO_UNIT_NAMEDSPACE 6
nsresult
NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmpaddedFrame* it = new (aPresShell) nsMathMLmpaddedFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmpaddedFrame;
}
nsMathMLmpaddedFrame::nsMathMLmpaddedFrame()

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

@ -48,7 +48,7 @@
class nsMathMLmpaddedFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell);
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent);

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

@ -51,19 +51,10 @@
// <mphantom> -- make content invisible but preserve its size
//
nsresult
NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmphantomFrame* it = new (aPresShell) nsMathMLmphantomFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmphantomFrame;
}
nsMathMLmphantomFrame::nsMathMLmphantomFrame()

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

@ -48,7 +48,7 @@
class nsMathMLmphantomFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell);
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent);

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

@ -68,19 +68,10 @@
static const PRUnichar kSqrChar = PRUnichar(0x221A);
nsresult
NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmrootFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmrootFrame* it = new (aPresShell) nsMathMLmrootFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmrootFrame;
}
nsMathMLmrootFrame::nsMathMLmrootFrame() :

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

@ -49,7 +49,7 @@
class nsMathMLmrootFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmrootFrame(nsIPresShell* aPresShell);
virtual void
SetAdditionalStyleContext(PRInt32 aIndex,

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

@ -52,19 +52,10 @@
// <mrow> -- horizontally group any number of subexpressions - implementation
//
nsresult
NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmrowFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmrowFrame* it = new (aPresShell) nsMathMLmrowFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmrowFrame;
}
nsMathMLmrowFrame::nsMathMLmrowFrame()

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

@ -48,7 +48,7 @@
class nsMathMLmrowFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell);
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent);

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

@ -52,19 +52,10 @@
// <mspace> -- space - implementation
//
nsresult
NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmspaceFrame* it = new (aPresShell) nsMathMLmspaceFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmspaceFrame;
}
nsMathMLmspaceFrame::nsMathMLmspaceFrame()

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

@ -47,7 +47,7 @@
class nsMathMLmspaceFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell);
NS_IMETHOD
Reflow(nsPresContext* aPresContext,

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

@ -68,19 +68,10 @@
static const PRUnichar kSqrChar = PRUnichar(0x221A);
nsresult
NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmsqrtFrame* it = new (aPresShell) nsMathMLmsqrtFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmsqrtFrame;
}
nsMathMLmsqrtFrame::nsMathMLmsqrtFrame() :

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

@ -73,7 +73,7 @@ TODO:
class nsMathMLmsqrtFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell);
virtual void
SetAdditionalStyleContext(PRInt32 aIndex,

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

@ -53,19 +53,10 @@
// <mstyle> -- style change
//
nsresult
NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmstyleFrame* it = new (aPresShell) nsMathMLmstyleFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmstyleFrame;
}
nsMathMLmstyleFrame::nsMathMLmstyleFrame()

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

@ -48,7 +48,7 @@
class nsMathMLmstyleFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell);
NS_IMETHOD
AttributeChanged(PRInt32 aNameSpaceID,

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

@ -53,19 +53,10 @@
// <msub> -- attach a subscript to a base - implementation
//
nsresult
NS_NewMathMLmsubFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmsubFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmsubFrame* it = new (aPresShell) nsMathMLmsubFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmsubFrame;
}
nsMathMLmsubFrame::nsMathMLmsubFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmsubFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmsubFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmsubFrame(nsIPresShell* aPresShell);
NS_IMETHOD
TransmitAutomaticData();

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

@ -53,19 +53,10 @@
// <msubsup> -- attach a subscript-superscript pair to a base - implementation
//
nsresult
NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmsubsupFrame* it = new (aPresShell) nsMathMLmsubsupFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmsubsupFrame;
}
nsMathMLmsubsupFrame::nsMathMLmsubsupFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmsubsupFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell);
NS_IMETHOD
TransmitAutomaticData();

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

@ -52,19 +52,10 @@
// <msup> -- attach a superscript to a base - implementation
//
nsresult
NS_NewMathMLmsupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmsupFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmsupFrame* it = new (aPresShell) nsMathMLmsupFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmsupFrame;
}
nsMathMLmsupFrame::nsMathMLmsupFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmsupFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmsupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmsupFrame(nsIPresShell* aPresShell);
NS_IMETHOD
TransmitAutomaticData();

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

@ -56,19 +56,10 @@
// <munder> -- attach an underscript to a base - implementation
//
nsresult
NS_NewMathMLmunderFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmunderFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmunderFrame* it = new (aPresShell) nsMathMLmunderFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmunderFrame;
}
nsMathMLmunderFrame::nsMathMLmunderFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmunderFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmunderFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmunderFrame(nsIPresShell* aPresShell);
NS_IMETHOD
Place(nsIRenderingContext& aRenderingContext,

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

@ -56,19 +56,10 @@
// <munderover> -- attach an underscript-overscript pair to a base - implementation
//
nsresult
NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMathMLmunderoverFrame* it = new (aPresShell) nsMathMLmunderoverFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMathMLmunderoverFrame;
}
nsMathMLmunderoverFrame::nsMathMLmunderoverFrame()

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

@ -49,7 +49,7 @@
class nsMathMLmunderoverFrame : public nsMathMLContainerFrame {
public:
friend nsresult NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell);
NS_IMETHOD
Place(nsIRenderingContext& aRenderingContext,

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

@ -50,8 +50,8 @@
class nsSVGCircleFrame : public nsSVGPathGeometryFrame
{
protected:
friend nsresult
NS_NewSVGCircleFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGCircleFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGCircleFrame();
NS_IMETHOD InitSVG();
@ -87,25 +87,18 @@ private:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGCircleFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGCircleFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGCircleElement> circle = do_QueryInterface(aContent);
if (!circle) {
#ifdef DEBUG
printf("warning: trying to construct an SVGCircleFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGCircleFrame* it = new (aPresShell) nsSVGCircleFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGCircleFrame;
}
nsSVGCircleFrame::~nsSVGCircleFrame()

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

@ -74,26 +74,18 @@ nsSVGClipPathFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(aContent);
if (!transformable) {
#ifdef DEBUG
printf("warning: trying to construct an SVGClipPathFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGClipPathFrame* it = new (aPresShell) nsSVGClipPathFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGClipPathFrame;
}
nsresult

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

@ -44,8 +44,8 @@ typedef nsSVGDefsFrame nsSVGClipPathFrameBase;
class nsSVGClipPathFrame : public nsSVGClipPathFrameBase
{
friend nsresult
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGClipPathFrame();
NS_IMETHOD InitSVG();

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

@ -50,18 +50,10 @@
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGDefsFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGDefsFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsSVGDefsFrame* it = new (aPresShell) nsSVGDefsFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGDefsFrame;
}
nsSVGDefsFrame::nsSVGDefsFrame()

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

@ -54,8 +54,8 @@ class nsSVGDefsFrame : public nsSVGDefsFrameBase,
public nsISVGValueObserver,
public nsSupportsWeakReference
{
friend nsresult
NS_NewSVGDefsFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGDefsFrame(nsIPresShell* aPresShell, nsIContent* aContent);
protected:
nsSVGDefsFrame();
virtual ~nsSVGDefsFrame();

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

@ -49,8 +49,8 @@
class nsSVGEllipseFrame : public nsSVGPathGeometryFrame
{
friend nsresult
NS_NewSVGEllipseFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGEllipseFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGEllipseFrame();
@ -86,25 +86,18 @@ class nsSVGEllipseFrame : public nsSVGPathGeometryFrame
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGEllipseFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGEllipseFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGEllipseElement> ellipse = do_QueryInterface(aContent);
if (!ellipse) {
#ifdef DEBUG
printf("warning: trying to construct an SVGEllipseFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGEllipseFrame* it = new (aPresShell) nsSVGEllipseFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGEllipseFrame;
}
nsSVGEllipseFrame::~nsSVGEllipseFrame()

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

@ -67,10 +67,8 @@ class nsSVGFilterFrame : public nsSVGDefsFrame,
public nsISVGFilterFrame
{
protected:
friend nsresult
NS_NewSVGFilterFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGFilterFrame();
NS_IMETHOD InitSVG();
@ -126,18 +124,10 @@ NS_INTERFACE_MAP_BEGIN(nsSVGFilterFrame)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISVGValue)
NS_INTERFACE_MAP_END_INHERITING(nsSVGDefsFrame)
nsresult
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsSVGFilterFrame* it = new (aPresShell) nsSVGFilterFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGFilterFrame;
}
nsresult

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

@ -72,8 +72,8 @@ class nsSVGForeignObjectFrame : public nsSVGForeignObjectFrameBase,
public nsISVGValueObserver,
public nsSupportsWeakReference
{
friend nsresult
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent);
protected:
nsSVGForeignObjectFrame();
virtual ~nsSVGForeignObjectFrame();
@ -178,26 +178,18 @@ protected:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGForeignObjectElement> foreignObject = do_QueryInterface(aContent);
if (!foreignObject) {
#ifdef DEBUG
printf("warning: trying to construct an SVGForeignObjectFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGForeignObjectFrame* it = new (aPresShell) nsSVGForeignObjectFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGForeignObjectFrame;
}
nsSVGForeignObjectFrame::nsSVGForeignObjectFrame()

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

@ -55,26 +55,18 @@
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
{
*aNewFrame = nsnull;
nsIFrame*
NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(aContent);
if (!transformable) {
#ifdef DEBUG
printf("warning: trying to construct an SVGGFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGGFrame* it = new (aPresShell) nsSVGGFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGGFrame;
}
nsIAtom *

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

@ -67,8 +67,8 @@ public:
#endif
protected:
friend nsresult
NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent);
// nsISVGChildFrame interface:
NS_IMETHOD PaintSVG(nsISVGRendererCanvas* canvas,

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

@ -41,16 +41,10 @@
//----------------------------------------------------------------------
// nsSVGGenericContainerFrame Implementation
nsresult
NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
nsSVGGenericContainerFrame* it = new (aPresShell) nsSVGGenericContainerFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGGenericContainerFrame;
}
nsSVGGenericContainerFrame::nsSVGGenericContainerFrame()

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

@ -54,8 +54,8 @@ class nsSVGGenericContainerFrame : public nsSVGGenericContainerFrameBase,
public nsISVGChildFrame,
public nsISVGContainerFrame
{
friend nsresult
NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent);
protected:
nsSVGGenericContainerFrame();
virtual ~nsSVGGenericContainerFrame();

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

@ -78,9 +78,9 @@ class nsSVGGlyphFrame : public nsSVGGlyphFrameBase,
public nsISVGChildFrame
{
protected:
friend nsresult
friend nsIFrame*
NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame* parentFrame, nsIFrame** aNewFrame);
nsIFrame* parentFrame);
nsSVGGlyphFrame();
virtual ~nsSVGGlyphFrame();
@ -210,12 +210,9 @@ protected:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parentFrame,
nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parentFrame)
{
*aNewFrame = nsnull;
#ifdef DEBUG
NS_ASSERTION(parentFrame, "null parent");
nsISVGTextContainerFrame *text_container;
@ -225,14 +222,8 @@ NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* pa
nsCOMPtr<nsITextContent> tc = do_QueryInterface(aContent);
NS_ASSERTION(tc, "trying to construct an SVGGlyphFrame for wrong content element");
#endif
nsSVGGlyphFrame* it = new (aPresShell) nsSVGGlyphFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGGlyphFrame;
}
nsSVGGlyphFrame::nsSVGGlyphFrame()

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

@ -48,13 +48,11 @@ nsresult NS_GetSVGGradient(nsISVGGradient** result,
nsIContent* aContent,
nsIPresShell* aPresShell);
nsresult NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
nsIFrame* NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent);
nsresult NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
nsIFrame* NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent);
#endif // __NS_SVGGRADIENT_H__

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

@ -80,18 +80,15 @@ class nsSVGGradientFrame : public nsSVGGradientFrameBase,
public nsISVGGradient
{
protected:
friend nsresult NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
friend nsIFrame* NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent);
friend nsresult NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
friend nsIFrame* NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent);
friend nsresult NS_NewSVGStopFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsIFrame** aNewFrame);
friend nsIFrame* NS_NewSVGStopFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame* aParentFrame);
friend nsresult NS_GetSVGGradientFrame(nsIFrame** result,
nsIURI* aURI,
@ -1160,20 +1157,17 @@ nsSVGRadialGradientFrame::GetR(float *aR)
// Public functions
// -------------------------------------------------------------------------
nsresult NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame)
nsIFrame* NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGLinearGradientElement> grad = do_QueryInterface(aContent);
NS_ASSERTION(grad, "NS_NewSVGLinearGradientFrame -- Content doesn't support nsIDOMSVGLinearGradient");
if (!grad)
return NS_ERROR_FAILURE;
return nsnull;
nsSVGLinearGradientFrame* it = new (aPresShell) nsSVGLinearGradientFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
return nsnull;
nsCOMPtr<nsIDOMSVGURIReference> aRef = do_QueryInterface(aContent);
NS_ASSERTION(aRef, "NS_NewSVGLinearGradientFrame -- Content doesn't support nsIDOMSVGURIReference");
@ -1191,25 +1185,20 @@ nsresult NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
}
it->mLoopFlag = PR_FALSE;
*aNewFrame = it;
return NS_OK;
return it;
}
nsresult NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGRadialGradientElement> grad = do_QueryInterface(aContent);
NS_ASSERTION(grad, "NS_NewSVGRadialGradientFrame -- Content doesn't support nsIDOMSVGRadialGradient");
if (!grad)
return NS_ERROR_FAILURE;
return nsnull;
nsSVGRadialGradientFrame* it = new (aPresShell) nsSVGRadialGradientFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
return nsnull;
nsCOMPtr<nsIDOMSVGURIReference> aRef = do_QueryInterface(aContent);
NS_ASSERTION(aRef, "NS_NewSVGRadialGradientFrame -- Content doesn't support nsIDOMSVGURIReference");
@ -1227,9 +1216,7 @@ nsresult NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
}
it->mLoopFlag = PR_FALSE;
*aNewFrame = it;
return NS_OK;
return it;
}
// Public function to locate the SVGGradientFrame structure pointed to by a URI

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

@ -43,12 +43,10 @@
#include "nsIContent.h"
#include "nsIPresShell.h"
nsresult NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
nsIFrame* NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent);
nsresult NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
nsIFrame* NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
nsIContent* aContent);
#endif // __NS_SVGGRADIENTFRAME_H__

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

@ -82,8 +82,8 @@ private:
class nsSVGImageFrame : public nsSVGPathGeometryFrame
{
protected:
friend nsresult
NS_NewSVGImageFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGImageFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGImageFrame();
NS_IMETHOD InitSVG();
@ -139,25 +139,18 @@ private:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGImageFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGImageFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGImageElement> Rect = do_QueryInterface(aContent);
if (!Rect) {
#ifdef DEBUG
printf("warning: trying to construct an SVGImageFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGImageFrame* it = new (aPresShell) nsSVGImageFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGImageFrame;
}
nsSVGImageFrame::~nsSVGImageFrame()

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

@ -67,8 +67,8 @@ class nsSVGInnerSVGFrame : public nsSVGInnerSVGFrameBase,
public nsSupportsWeakReference,
public nsISVGSVGFrame
{
friend nsresult
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent);
protected:
nsSVGInnerSVGFrame();
virtual ~nsSVGInnerSVGFrame();
@ -170,16 +170,10 @@ protected:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
nsSVGInnerSVGFrame* it = new (aPresShell) nsSVGInnerSVGFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGInnerSVGFrame;
}
nsSVGInnerSVGFrame::nsSVGInnerSVGFrame() : mFilter(nsnull),

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

@ -52,8 +52,8 @@ class nsSVGLineFrame : public nsSVGPathGeometryFrame,
public nsISVGMarkable
{
protected:
friend nsresult
NS_NewSVGLineFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGLineFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGLineFrame();
NS_IMETHOD InitSVG();
@ -103,25 +103,18 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGPathGeometryFrame)
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGLineFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGLineFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGLineElement> line = do_QueryInterface(aContent);
if (!line) {
#ifdef DEBUG
printf("warning: trying to construct an SVGLineFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGLineFrame* it = new (aPresShell) nsSVGLineFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGLineFrame;
}
nsSVGLineFrame::~nsSVGLineFrame()

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

@ -86,18 +86,10 @@ nsSVGMarkerFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return (nsSVGDefsFrame::QueryInterface(aIID, aInstancePtr));
}
nsresult
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsSVGMarkerFrame* it = new (aPresShell) nsSVGMarkerFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGMarkerFrame;
}
nsresult

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

@ -57,10 +57,8 @@ class nsSVGPathGeometryFrame;
class nsSVGMarkerFrame : public nsSVGDefsFrame
{
protected:
friend nsresult
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGMarkerFrame();
NS_IMETHOD InitSVG();

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

@ -158,8 +158,8 @@ class nsSVGOuterSVGFrame : public nsSVGOuterSVGFrameBase,
public nsSupportsWeakReference,
public nsSVGCoordCtxProvider
{
friend nsresult
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent);
protected:
nsSVGOuterSVGFrame();
virtual ~nsSVGOuterSVGFrame();
@ -282,26 +282,18 @@ protected:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
{
*aNewFrame = nsnull;
nsIFrame*
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
nsCOMPtr<nsIDOMSVGSVGElement> svgElement = do_QueryInterface(aContent);
if (!svgElement) {
#ifdef DEBUG
printf("warning: trying to construct an SVGOuterSVGFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGOuterSVGFrame* it = new (aPresShell) nsSVGOuterSVGFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGOuterSVGFrame;
}
nsSVGOuterSVGFrame::nsSVGOuterSVGFrame()

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

@ -56,8 +56,8 @@ class nsSVGPathFrame : public nsSVGPathGeometryFrame,
public nsISVGPathFlatten
{
protected:
friend nsresult
NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIContent* aContent);
~nsSVGPathFrame();
NS_IMETHOD InitSVG();
@ -108,25 +108,18 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGPathGeometryFrame)
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGAnimatedPathData> anim_data = do_QueryInterface(aContent);
if (!anim_data) {
#ifdef DEBUG
printf("warning: trying to construct an SVGPathFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGPathFrame* it = new (aPresShell) nsSVGPathFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGPathFrame;
}
nsSVGPathFrame::~nsSVGPathFrame()

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

@ -96,9 +96,8 @@ class nsSVGPatternFrame : public nsSVGPatternFrameBase,
public nsISVGPattern
{
protected:
friend nsresult NS_NewSVGPatternFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame);
friend nsIFrame* NS_NewSVGPatternFrame(nsIPresShell* aPresShell,
nsIContent* aContent);
friend nsresult NS_GetSVGPatternFrame(nsIFrame** result,
nsIURI* aURI,
@ -1175,21 +1174,18 @@ nsSVGPatternFrame::GetPatternMatrix(nsIDOMSVGMatrix **ctm, nsIDOMSVGRect *bbox,
// Public functions
// -------------------------------------------------------------------------
nsresult NS_NewSVGPatternFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame** aNewFrame)
nsIFrame* NS_NewSVGPatternFrame(nsIPresShell* aPresShell,
nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGPatternElement> pattern = do_QueryInterface(aContent);
NS_ASSERTION(pattern,
"NS_NewSVGPatternFrame -- Content doesn't support nsIDOMSVGPattern");
if (!pattern)
return NS_ERROR_FAILURE;
return nsnull;
nsSVGPatternFrame* it = new (aPresShell) nsSVGPatternFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
return nsnull;
nsCOMPtr<nsIDOMSVGURIReference> aRef = do_QueryInterface(aContent);
NS_ASSERTION(aRef,
@ -1210,9 +1206,7 @@ nsresult NS_NewSVGPatternFrame(nsIPresShell* aPresShell,
#endif
}
*aNewFrame = it;
return NS_OK;
return it;
}
// Public function to locate the SVGPatternFrame structure pointed to by a URI

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

@ -50,8 +50,8 @@ class nsSVGPolygonFrame : public nsSVGPathGeometryFrame,
public nsISVGMarkable
{
protected:
friend nsresult
NS_NewSVGPolygonFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGPolygonFrame(nsIPresShell* aPresShell, nsIContent* aContent);
~nsSVGPolygonFrame();
@ -100,23 +100,18 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGPathGeometryFrame)
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGPolygonFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGPolygonFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
nsCOMPtr<nsIDOMSVGAnimatedPoints> anim_points = do_QueryInterface(aContent);
if (!anim_points) {
#ifdef DEBUG
printf("warning: trying to construct an SVGPolygonFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGPolygonFrame* it = new (aPresShell) nsSVGPolygonFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGPolygonFrame;
}
nsSVGPolygonFrame::~nsSVGPolygonFrame()

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

@ -50,8 +50,8 @@ class nsSVGPolylineFrame : public nsSVGPathGeometryFrame,
public nsISVGMarkable
{
protected:
friend nsresult
NS_NewSVGPolylineFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGPolylineFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGPolylineFrame();
NS_IMETHOD InitSVG();
@ -100,23 +100,18 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGPathGeometryFrame)
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGPolylineFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGPolylineFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
nsCOMPtr<nsIDOMSVGAnimatedPoints> anim_points = do_QueryInterface(aContent);
if (!anim_points) {
#ifdef DEBUG
printf("warning: trying to construct an SVGPolylineFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGPolylineFrame* it = new (aPresShell) nsSVGPolylineFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGPolylineFrame;
}
nsSVGPolylineFrame::~nsSVGPolylineFrame()

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

@ -51,9 +51,8 @@
class nsSVGRectFrame : public nsSVGPathGeometryFrame
{
protected:
friend nsresult
NS_NewSVGRectFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGRectFrame(nsIPresShell* aPresShell, nsIContent* aContent);
virtual ~nsSVGRectFrame();
NS_IMETHOD InitSVG();
@ -92,24 +91,16 @@ private:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGRectFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGRectFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGRectElement> Rect = do_QueryInterface(aContent);
if (!Rect) {
NS_ASSERTION(Rect != nsnull, "wrong content element");
return NS_ERROR_NO_INTERFACE;
return nsnull;
}
nsSVGRectFrame* it = new (aPresShell) nsSVGRectFrame;
if (!it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGRectFrame;
}
nsSVGRectFrame::~nsSVGRectFrame()

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

@ -89,10 +89,9 @@ class nsSVGStopFrame : public nsSVGStopFrameBase,
nsISVGValue::modificationType aModType);
protected:
friend nsresult NS_NewSVGStopFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsIFrame** aNewFrame);
friend nsIFrame* NS_NewSVGStopFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame* aParentFrame);
virtual ~nsSVGStopFrame();
private:
@ -198,13 +197,10 @@ nsSVGStopFrame::DidModifySVGObservable(nsISVGValue* observable,
// Public functions
// -------------------------------------------------------------------------
nsresult NS_NewSVGStopFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsIFrame** aNewFrame)
nsIFrame* NS_NewSVGStopFrame(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIFrame* aParentFrame)
{
*aNewFrame = nsnull;
#ifdef DEBUG_scooter
printf("NS_NewSVGStopFrame\n");
#endif
@ -212,15 +208,9 @@ nsresult NS_NewSVGStopFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIDOMSVGStopElement> grad = do_QueryInterface(aContent);
NS_ASSERTION(grad, "NS_NewSVGStopFrame -- Content doesn't support nsIDOMSVGStopElement");
if (!grad)
return NS_ERROR_FAILURE;
return nsnull;
nsSVGStopFrame* it = new (aPresShell) nsSVGStopFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGStopFrame;
}
nsSVGStopFrame::~nsSVGStopFrame()

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

@ -42,35 +42,27 @@
//----------------------------------------------------------------------
// Implementation
nsresult
nsIFrame*
NS_NewSVGTSpanFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame* parentFrame, nsIFrame** aNewFrame)
nsIFrame* parentFrame)
{
*aNewFrame = nsnull;
NS_ASSERTION(parentFrame, "null parent");
nsISVGTextContainerFrame *text_container;
parentFrame->QueryInterface(NS_GET_IID(nsISVGTextContainerFrame),
(void**)&text_container);
if (!text_container) {
NS_ERROR("trying to construct an SVGTSpanFrame for an invalid container");
return NS_ERROR_FAILURE;
return nsnull;
}
nsCOMPtr<nsIDOMSVGTSpanElement> tspan_elem = do_QueryInterface(aContent);
if (!tspan_elem) {
NS_ERROR("Trying to construct an SVGTSpanFrame for a "
"content element that doesn't support the right interfaces");
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGTSpanFrame* it = new (aPresShell) nsSVGTSpanFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGTSpanFrame;
}
nsSVGTSpanFrame::nsSVGTSpanFrame()

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

@ -75,9 +75,9 @@ class nsSVGTSpanFrame : public nsSVGTSpanFrameBase,
public nsISVGValueObserver,
public nsSupportsWeakReference
{
friend nsresult
friend nsIFrame*
NS_NewSVGTSpanFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame* parentFrame, nsIFrame** aNewFrame);
nsIFrame* parentFrame);
protected:
nsSVGTSpanFrame();
virtual ~nsSVGTSpanFrame();

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

@ -79,9 +79,8 @@ class nsSVGTextFrame : public nsSVGTextFrameBase,
public nsISVGTextContentMetrics,
public nsSupportsWeakReference
{
friend nsresult
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent);
protected:
nsSVGTextFrame();
virtual ~nsSVGTextFrame();
@ -214,28 +213,19 @@ protected:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGTextElement> text_elem = do_QueryInterface(aContent);
if (!text_elem) {
#ifdef DEBUG
printf("warning: trying to construct an SVGTextFrame for a "
"content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGTextFrame* it = new (aPresShell) nsSVGTextFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGTextFrame;
}
nsSVGTextFrame::nsSVGTextFrame()

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

@ -111,34 +111,26 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGTSpanFrame)
//----------------------------------------------------------------------
// Implementation
nsresult
nsIFrame*
NS_NewSVGTextPathFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame* parentFrame, nsIFrame** aNewFrame)
nsIFrame* parentFrame)
{
*aNewFrame = nsnull;
NS_ASSERTION(parentFrame, "null parent");
nsISVGTextFrame *text_container;
parentFrame->QueryInterface(NS_GET_IID(nsISVGTextFrame), (void**)&text_container);
if (!text_container) {
NS_ERROR("trying to construct an SVGTextPathFrame for an invalid container");
return NS_ERROR_FAILURE;
return nsnull;
}
nsCOMPtr<nsIDOMSVGTextPathElement> tspan_elem = do_QueryInterface(aContent);
if (!tspan_elem) {
NS_ERROR("Trying to construct an SVGTextPathFrame for a "
"content element that doesn't support the right interfaces");
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGTextPathFrame* it = new (aPresShell) nsSVGTextPathFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGTextPathFrame;
}
nsSVGTextPathFrame::~nsSVGTextPathFrame()

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

@ -50,8 +50,8 @@ typedef nsSVGGFrame nsSVGUseFrameBase;
class nsSVGUseFrame : public nsSVGUseFrameBase,
public nsIAnonymousContentCreator
{
friend nsresult
NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsIContent* aContent);
protected:
@ -98,26 +98,18 @@ protected:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
*aNewFrame = nsnull;
nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(aContent);
if (!transformable) {
#ifdef DEBUG
printf("warning: trying to construct an SVGUseFrame for a content element that doesn't support the right interfaces\n");
#endif
return NS_ERROR_FAILURE;
return nsnull;
}
nsSVGUseFrame* it = new (aPresShell) nsSVGUseFrame;
if (it == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSVGUseFrame;
}
NS_IMETHODIMP

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

@ -50,8 +50,8 @@ class nsXTFSVGDisplayFrame : public nsXTFSVGDisplayFrameBase,
public nsIAnonymousContentCreator
{
public:
friend nsresult
NS_NewXTFSVGDisplayFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
friend nsIFrame*
NS_NewXTFSVGDisplayFrame(nsIPresShell* aPresShell, nsIContent* aContent);
// nsISupports interface:
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
private:
@ -74,16 +74,10 @@ protected:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewXTFSVGDisplayFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame)
nsIFrame*
NS_NewXTFSVGDisplayFrame(nsIPresShell* aPresShell, nsIContent* aContent)
{
nsXTFSVGDisplayFrame* it = new (aPresShell) nsXTFSVGDisplayFrame;
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsXTFSVGDisplayFrame;
}
//----------------------------------------------------------------------

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

@ -51,9 +51,7 @@
////////////////////////////////////////////////////////////////////////
// nsXTFXMLBlockDisplayFrame
nsresult NS_NewXTFXMLDisplayFrame(nsIPresShell* aPresShell,
PRBool isBlock, nsIFrame** aNewFrame);
nsIFrame* NS_NewXTFXMLDisplayFrame(nsIPresShell* aPresShell, PRBool isBlock);
typedef nsBlockFrame nsXTFXMLBlockDisplayFrameBase;
@ -148,10 +146,6 @@ nsXTFXMLBlockDisplayFrame::CreateAnonymousContent(nsPresContext* aPresContext,
////////////////////////////////////////////////////////////////////////
// nsXTFXMLInlineDisplayFrame
nsresult NS_NewXTFXMLDisplayFrame(nsIPresShell* aPresShell,
PRBool isInline, nsIFrame** aNewFrame);
typedef nsInlineFrame nsXTFXMLInlineDisplayFrameBase;
class nsXTFXMLInlineDisplayFrame : public nsXTFXMLInlineDisplayFrameBase,
@ -245,16 +239,11 @@ nsXTFXMLInlineDisplayFrame::CreateAnonymousContent(nsPresContext* aPresContext,
////////////////////////////////////////////////////////////////////////
// Construction API
nsresult
NS_NewXTFXMLDisplayFrame(nsIPresShell* aPresShell, PRBool isBlock, nsIFrame** aNewFrame)
nsIFrame*
NS_NewXTFXMLDisplayFrame(nsIPresShell* aPresShell, PRBool isBlock)
{
if (isBlock)
*aNewFrame = new (aPresShell) nsXTFXMLBlockDisplayFrame();
return new (aPresShell) nsXTFXMLBlockDisplayFrame();
else
*aNewFrame = new (aPresShell) nsXTFXMLInlineDisplayFrame();
if (nsnull == *aNewFrame)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
return new (aPresShell) nsXTFXMLInlineDisplayFrame();
}

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

@ -48,8 +48,7 @@ class nsXTFXULDisplayFrame : public nsXTFXULDisplayFrameBase,
public nsIAnonymousContentCreator
{
public:
friend nsresult
NS_NewXTFXULDisplayFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewXTFXULDisplayFrame(nsIPresShell* aPresShell);
nsXTFXULDisplayFrame(nsIPresShell* aPresShell);
@ -81,16 +80,10 @@ public:
//----------------------------------------------------------------------
// Implementation
nsresult
NS_NewXTFXULDisplayFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewXTFXULDisplayFrame(nsIPresShell* aPresShell)
{
nsXTFXULDisplayFrame* it = new (aPresShell) nsXTFXULDisplayFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsXTFXULDisplayFrame(aPresShell);
}
nsXTFXULDisplayFrame::nsXTFXULDisplayFrame(nsIPresShell* aPresShell)