NS_NewSVGMatrix(getter_AddRefs(mViewBoxToViewportTransform), a,     0.0f, 0.0f,  d, e,     f);
rv = NS_NewSVGMatrix(getter_AddRefs(mViewBoxToViewportTransform), a,     0.0f, 0.0f,  d, e,     f);
nsSVGMarkerElement::GetViewboxToViewportTransform(nsIDOMSVGMatrix **_retval){  if (!mViewBoxToViewportTransform) {    float viewportWidth;    {      nsCOMPtr<nsIDOMSVGLength> l;      mMarkerWidth->GetAnimVal(getter_AddRefs(l));      l->GetValue(&viewportWidth);    }    float viewportHeight;    {      nsCOMPtr<nsIDOMSVGLength> l;      mMarkerHeight->GetAnimVal(getter_AddRefs(l));      l->GetValue(&viewportHeight);    }    float viewboxX, viewboxY, viewboxWidth, viewboxHeight;    {      nsCOMPtr<nsIDOMSVGRect> vb;      mViewBox->GetAnimVal(getter_AddRefs(vb));      NS_ASSERTION(vb, "could not get viewbox");      vb->GetX(&viewboxX);      vb->GetY(&viewboxY);      vb->GetWidth(&viewboxWidth);      vb->GetHeight(&viewboxHeight);    }    if (viewboxWidth==0.0f || viewboxHeight==0.0f) {      NS_ERROR("XXX. We shouldn't get here. Viewbox width/height is set to 0. Need to disable display of element as per specs.");      viewboxWidth = 1.0f;      viewboxHeight = 1.0f;    }        PRUint16 align, meetOrSlice;    {      nsCOMPtr<nsIDOMSVGPreserveAspectRatio> par;      mPreserveAspectRatio->GetAnimVal(getter_AddRefs(par));      NS_ASSERTION(par, "could not get preserveAspectRatio");      par->GetAlign(&align);      par->GetMeetOrSlice(&meetOrSlice);    }    // default to the defaults    if (align == nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_UNKNOWN)      align = nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_XMIDYMID;    if (meetOrSlice == nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_UNKNOWN)      align = nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET;        float a, d, e, f;    a = viewportWidth/viewboxWidth;    d = viewportHeight/viewboxHeight;    e = 0.0f;    f = 0.0f;    if (align != nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE &&        a != d) {      if (meetOrSlice == nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET &&          a < d ||          meetOrSlice == nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_SLICE &&          d < a) {        d = a;      }      else if (        meetOrSlice == nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET &&        d < a ||        meetOrSlice == nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_SLICE &&        a < d) {        a = d;      }      else NS_NOTREACHED("Unknown value for meetOrSlice");    }    if (viewboxX) e += -a * viewboxX;    if (viewboxY) f += -d * viewboxY;    float refX;    {      nsCOMPtr<nsIDOMSVGLength> l;      mRefX->GetAnimVal(getter_AddRefs(l));      l->GetValue(&refX);    }    float refY;    {      nsCOMPtr<nsIDOMSVGLength> l;      mRefY->GetAnimVal(getter_AddRefs(l));      l->GetValue(&refY);    }    e -= refX * a;    f -= refY * d;    #ifdef DEBUG    printf("Marker Viewport=(0?,0?,%f,%f)\n", viewportWidth, viewportHeight);    printf("Marker Viewbox=(%f,%f,%f,%f)\n", viewboxX, viewboxY, viewboxWidth, viewboxHeight);    printf("Marker Viewbox->Viewport xform [a c e] = [%f,   0, %f]\n", a, e);    printf("                            [b d f] = [   0,  %f, %f]\n", d, f);#endif        NS_NewSVGMatrix(getter_AddRefs(mViewBoxToViewportTransform),                    a,     0.0f,                    0.0f,  d,                    e,     f);  }  *_retval = mViewBoxToViewportTransform;  NS_IF_ADDREF(*_retval);  return NS_OK;}