NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);
if (!doc) return NS_ERROR_OUT_OF_MEMORY;
NS_NewSVGDocument(nsIDocument** aInstancePtrResult){  nsSVGDocument* doc = new nsSVGDocument();  NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);  NS_ADDREF(doc);  nsresult rv = doc->Init();  if (NS_FAILED(rv)) {    NS_RELEASE(doc);    return rv;  }  *aInstancePtrResult = doc;  return rv;}