nsresult rv = mMetrics->GetBoundingBox(_retval); if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
if (!mMetrics || NS_FAILED(mMetrics->GetBoundingBox(_retval))) return NS_ERROR_FAILURE;
nsSVGGlyphFrame::GetBBox(nsIDOMSVGRect **_retval){  *_retval = nsnull;  nsresult rv = mMetrics->GetBoundingBox(_retval);  if (NS_FAILED(rv)) return NS_ERROR_FAILURE;    float x[4], y[4], width, height;  (*_retval)->GetX(&x[0]);  (*_retval)->GetY(&y[0]);  (*_retval)->GetWidth(&width);  (*_retval)->GetHeight(&height);  // offset the bounds by the position of this glyph fragment:  x[0] += mX;  y[0] += mY;  x[1] = x[0] + width;  y[1] = y[0];  x[2] = x[0] + width;  y[2] = y[0] + height;  x[3] = x[0];  y[3] = y[0] + height;  TransformPoint(x[0], y[0]);  TransformPoint(x[1], y[1]);  TransformPoint(x[2], y[2]);  TransformPoint(x[3], y[3]);  float xmin, xmax, ymin, ymax;  xmin = xmax = x[0];  ymin = ymax = y[0];  for (int i=1; i<4; i++) {    if (x[i] < xmin)      xmin = x[i];    if (y[i] < ymin)      ymin = y[i];    if (x[i] > xmax)      xmax = x[i];    if (y[i] > ymax)      ymax = y[i];  }  return NS_NewSVGRect(_retval, xmin, ymin, xmax - xmin, ymax - ymin);}