Bug 697475: deCOMtaminate nsSVGPatternFrame::GetPatternFirstChild. r=longsonr

This commit is contained in:
Daniel Holbert 2011-10-27 15:57:10 -07:00
parent d57dd02018
commit 98faa79b9c
2 changed files with 11 additions and 11 deletions

View File

@ -196,8 +196,8 @@ nsSVGPatternFrame::PaintPattern(gfxASurface** surface,
*surface = nsnull; *surface = nsnull;
// Get the first child of the pattern data we will render // Get the first child of the pattern data we will render
nsIFrame *firstKid; nsIFrame* firstKid = GetPatternFirstChild();
if (NS_FAILED(GetPatternFirstChild(&firstKid))) if (!firstKid)
return NS_ERROR_FAILURE; // Either no kids or a bad reference return NS_ERROR_FAILURE; // Either no kids or a bad reference
/* /*
@ -351,22 +351,22 @@ nsSVGPatternFrame::PaintPattern(gfxASurface** surface,
// How do we handle the insertion of a new frame? // How do we handle the insertion of a new frame?
// We really don't want to rerender this every time, // We really don't want to rerender this every time,
// do we? // do we?
NS_IMETHODIMP nsIFrame*
nsSVGPatternFrame::GetPatternFirstChild(nsIFrame **kid) nsSVGPatternFrame::GetPatternFirstChild()
{ {
// Do we have any children ourselves? // Do we have any children ourselves?
*kid = mFrames.FirstChild(); nsIFrame* kid = mFrames.FirstChild();
if (*kid) if (kid)
return NS_OK; return kid;
// No, see if we chain to someone who does // No, see if we chain to someone who does
AutoPatternReferencer patternRef(this); AutoPatternReferencer patternRef(this);
nsSVGPatternFrame *next = GetReferencedPatternIfNotInUse(); nsSVGPatternFrame* next = GetReferencedPatternIfNotInUse();
if (!next) if (!next)
return NS_ERROR_FAILURE; return nsnull;
return next->GetPatternFirstChild(kid); return next->GetPatternFirstChild();
} }
PRUint16 PRUint16

View File

@ -143,7 +143,7 @@ protected:
nsIFrame *aSource, nsIFrame *aSource,
float aGraphicOpacity, float aGraphicOpacity,
const gfxRect *aOverrideBounds); const gfxRect *aOverrideBounds);
NS_IMETHOD GetPatternFirstChild(nsIFrame **kid); nsIFrame* GetPatternFirstChild();
gfxRect GetPatternRect(const gfxRect &bbox, gfxRect GetPatternRect(const gfxRect &bbox,
const gfxMatrix &callerCTM, const gfxMatrix &callerCTM,
nsIFrame *aTarget); nsIFrame *aTarget);