nsresult rv; nsIHTMLStyleSheet* sheet; if (NS_FAILED(rv = NS_NewHTMLStyleSheet(&sheet))) return rv;  if (NS_FAILED(rv = sheet->Init(aURL, aDocument))) { NS_RELEASE(sheet); return rv;
if (aInstancePtrResult == nsnull) { return NS_ERROR_NULL_POINTER;
NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult, nsIURL* aURL,                      nsIDocument* aDocument){  nsresult rv;  nsIHTMLStyleSheet* sheet;  if (NS_FAILED(rv = NS_NewHTMLStyleSheet(&sheet)))    return rv;  if (NS_FAILED(rv = sheet->Init(aURL, aDocument))) {    NS_RELEASE(sheet);    return rv;  }  *aInstancePtrResult = sheet;  return NS_OK;}