nsCOMPtr<nsIDOMSVGAnimatedEnumeration> aEnum; nsCOMPtr<nsIDOMSVGGradientElement> aGrad = do_QueryInterface(mContent); NS_ASSERTION(aGrad, "Wrong content element (not gradient)"); if (aGrad == nsnull) { return NS_ERROR_FAILURE;
if (!mSpreadMethod) { PrivateGetSpreadMethod(getter_AddRefs(mSpreadMethod)); if (!mSpreadMethod) return NS_ERROR_FAILURE; NS_ADD_SVGVALUE_OBSERVER(mSpreadMethod);
nsSVGGradientFrame::GetSpreadMethod(PRUint16 *aSpreadMethod){  nsCOMPtr<nsIDOMSVGAnimatedEnumeration> aEnum;  nsCOMPtr<nsIDOMSVGGradientElement> aGrad = do_QueryInterface(mContent);  NS_ASSERTION(aGrad, "Wrong content element (not gradient)");  if (aGrad == nsnull) {    return NS_ERROR_FAILURE;  }  // See if we need to get the value from another gradient  if (!checkURITarget(nsSVGAtoms::spreadMethod)) {    // No, return the values    aGrad->GetSpreadMethod(getter_AddRefs(aEnum));    aEnum->GetAnimVal(aSpreadMethod);  } else {    // Yes, get it from the target    mNextGrad->GetSpreadMethod(aSpreadMethod);  }  return NS_OK;}