*aGradientTransform = mGradientTransform; NS_ADDREF(*aGradientTransform);
nsCOMPtr<nsIDOMSVGMatrix> bboxTransform; PRUint16 bbox; GetGradientUnits(&bbox); if (bbox == nsIDOMSVGGradientElement::SVG_GRUNITS_OBJECTBOUNDINGBOX) { nsISVGChildFrame *frame = nsnull; if (aSource) CallQueryInterface(aSource, &frame); nsCOMPtr<nsIDOMSVGRect> rect; if (frame) { frame->SetMatrixPropagation(PR_FALSE); frame->NotifyCanvasTMChanged(); frame->GetBBox(getter_AddRefs(rect)); frame->SetMatrixPropagation(PR_TRUE); frame->NotifyCanvasTMChanged(); } if (rect) { float x, y, width, height; rect->GetX(&x); rect->GetY(&y); rect->GetWidth(&width); rect->GetHeight(&height); NS_NewSVGMatrix(getter_AddRefs(bboxTransform), width, 0, 0, height, x, y); } }  if (!bboxTransform) NS_NewSVGMatrix(getter_AddRefs(bboxTransform));  nsCOMPtr<nsIDOMSVGMatrix> gradientTransform;  if (!checkURITarget(nsSVGAtoms::gradientTransform)) {  aGrad->GetGradientTransform(getter_AddRefs(aTrans)); nsCOMPtr<nsIDOMSVGTransformList> lTrans; aTrans->GetAnimVal(getter_AddRefs(lTrans)); lTrans->GetConsolidationMatrix(getter_AddRefs(gradientTransform)); } else {  mNextGrad->GetGradientTransform(getter_AddRefs(gradientTransform), nsnull); }  bboxTransform->Multiply(gradientTransform, aGradientTransform);
nsSVGGradientFrame::GetGradientTransform(nsIDOMSVGMatrix **aGradientTransform,                                         nsISVGGeometrySource *aSource){  if (!mGradientTransform) {    PrivateGetGradientTransform(getter_AddRefs(mGradientTransform),aSource);    if (!mGradientTransform)      return NS_ERROR_FAILURE;    NS_ADD_SVGVALUE_OBSERVER(mGradientTransform);  }  *aGradientTransform = mGradientTransform;  NS_ADDREF(*aGradientTransform);  return NS_OK;}