From 163db1b85d12b9dfde36017bd5183557d4bd8f7e Mon Sep 17 00:00:00 2001 From: "scootermorris%comcast.net" Date: Fri, 3 Feb 2006 21:11:17 +0000 Subject: [PATCH] Fix for bug 325283: Gradients on text causes crash r=tor git-svn-id: svn://10.0.0.236/trunk@188878 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp b/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp index ea2f38ac585..2cb1afd85c5 100644 --- a/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp @@ -539,7 +539,16 @@ nsSVGGradientFrame::GetGradientTransform(nsIDOMSVGMatrix **aGradientTransform, } else { nsIFrame *frame = nsnull; CallQueryInterface(aSource, &frame); - mSourceContent = frame->GetContent(); + + // If this gradient is applied to text, our caller + // will be the glyph, which is not a container, so we + // need to get the parent + nsIAtom *callerType = frame->GetType(); + if (callerType == nsLayoutAtoms::svgGlyphFrame) + mSourceContent = frame->GetContent()->GetParent(); + else + mSourceContent = frame->GetContent(); + NS_ASSERTION(mSourceContent, "Can't get content for gradient"); } if (!bboxTransform)