if (mDocument) { rv = mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup)); if (NS_FAILED(rv)) return rv; }
if (mDocument) loadGroup = mDocument->GetDocumentLoadGroup();
PresShell::AddDummyLayoutRequest(void){   nsresult rv = NS_OK;  if (gAsyncReflowDuringDocLoad && !mIsReflowing) {    rv = nsDummyLayoutRequest::Create(getter_AddRefs(mDummyLayoutRequest), this);    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsILoadGroup> loadGroup;    if (mDocument) {      rv = mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));      if (NS_FAILED(rv)) return rv;    }    if (loadGroup) {      rv = mDummyLayoutRequest->SetLoadGroup(loadGroup);      if (NS_FAILED(rv)) return rv;      rv = loadGroup->AddRequest(mDummyLayoutRequest, nsnull);      if (NS_FAILED(rv)) return rv;      PR_LOG(gLog, PR_LOG_ALWAYS,             ("presshell=%p, Added dummy layout request %p", this, mDummyLayoutRequest.get()));    }  }  return rv;}