rv = aOwnerDocument->GetNodeInfoManager(getter_AddRefs(nimgr));
nimgr = aOwnerDocument->GetNodeInfoManager();
NS_NewDocumentFragment(nsIDOMDocumentFragment** aInstancePtrResult,                       nsIDocument* aOwnerDocument){  NS_ENSURE_ARG_POINTER(aInstancePtrResult);  nsCOMPtr<nsINodeInfoManager> nimgr;  nsCOMPtr<nsINodeInfo> nodeInfo;  nsresult rv;  if (aOwnerDocument) {    rv = aOwnerDocument->GetNodeInfoManager(getter_AddRefs(nimgr));  } else {    rv = nsNodeInfoManager::GetAnonymousManager(getter_AddRefs(nimgr));  }  NS_ENSURE_SUCCESS(rv, rv);  rv = nimgr->GetNodeInfo(NS_LITERAL_STRING("#document-fragment"),                          nsnull, kNameSpaceID_None,                          getter_AddRefs(nodeInfo));  NS_ENSURE_SUCCESS(rv, rv);  nsDocumentFragment* it = new nsDocumentFragment(aOwnerDocument);  if (!it) {    return NS_ERROR_OUT_OF_MEMORY;  }  rv = it->Init(nodeInfo);  if (NS_FAILED(rv)) {    delete it;    return rv;  }  *aInstancePtrResult = NS_STATIC_CAST(nsIDOMDocumentFragment *, it);  NS_ADDREF(*aInstancePtrResult);  return NS_OK;}