nsCOMPtr<nsIDOMSVGLinearGradientElement> aLgrad = do_QueryInterface(mContent); NS_ASSERTION(aLgrad, "Wrong content element (not linear gradient)"); if (aLgrad == nsnull) { return NS_ERROR_FAILURE;
if (!mX2) { PrivateGetX2(getter_AddRefs(mX2)); if (!mX2) return NS_ERROR_FAILURE; NS_ADD_SVGVALUE_OBSERVER(mX2);
nsSVGLinearGradientFrame::GetX2(float *aX2){  nsCOMPtr<nsIDOMSVGLinearGradientElement> aLgrad = do_QueryInterface(mContent);  NS_ASSERTION(aLgrad, "Wrong content element (not linear gradient)");  if (aLgrad == nsnull) {    return NS_ERROR_FAILURE;  }  // See if we need to get the value from another gradient  if (checkURITarget(nsSVGAtoms::x2)) {    // Yes, get it from the target    nsISVGGradient *aNextGrad;    if (nsSVGGradientFrame::GetNextGradient(&aNextGrad, nsISVGGradient::SVG_LINEAR_GRADIENT) == NS_OK) {      nsCOMPtr<nsISVGLinearGradient> aLNgrad = do_QueryInterface(aNextGrad);      aLNgrad->GetX2(aX2);      return NS_OK;    }    // There are no gradients in the list with our type -- fall through    // and return our default value  }  // No, return the values  nsCOMPtr<nsIDOMSVGAnimatedLength> aLen;  aLgrad->GetX2(getter_AddRefs(aLen));  nsCOMPtr<nsIDOMSVGLength> sLen;  aLen->GetAnimVal(getter_AddRefs(sLen));  sLen->GetValue(aX2);  return NS_OK;}