if (rv == NS_OK) rv = mImageGroup->Init(mDeviceContext, loadGroup);
nsPresContext::GetImageGroup(nsIImageGroup** aResult){  NS_PRECONDITION(nsnull != aResult, "null ptr");  if (nsnull == aResult) {    return NS_ERROR_NULL_POINTER;  }  if (!mImageGroup) {    // Create image group    nsresult rv = NS_NewImageGroup(getter_AddRefs(mImageGroup));    if (NS_OK != rv) {      return rv;    }    // Initialize the image group    nsCOMPtr<nsILoadGroup> loadGroup;    nsCOMPtr<nsIDocument> doc;    if (NS_SUCCEEDED(mShell->GetDocument(getter_AddRefs(doc)))) {      NS_ASSERTION(doc, "expect document here");      if (doc) {        doc->GetDocumentLoadGroup(getter_AddRefs(loadGroup));      }    }    if (rv == NS_OK)      rv = mImageGroup->Init(mDeviceContext, loadGroup);    if (NS_OK != rv) {      return rv;    }  }  *aResult = mImageGroup;  NS_IF_ADDREF(*aResult);  return NS_OK;}