Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsDOMDocumentType.cpp File Reference
#include "nsDOMDocumentType.h"
#include "nsDOMAttributeMap.h"
#include "nsIDOMNamedNodeMap.h"
#include "nsLayoutAtoms.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsDOMString.h"
#include "nsIDOM3Node.h"
#include "nsNodeInfoManager.h"

Go to the source code of this file.

Functions

nsresult NS_NewDOMDocumentType (nsIDOMDocumentType **aDocType, nsNodeInfoManager *aNodeInfoManager, nsIPrincipal *aPrincipal, nsIAtom *aName, nsIDOMNamedNodeMap *aEntities, nsIDOMNamedNodeMap *aNotations, const nsAString &aPublicId, const nsAString &aSystemId, const nsAString &aInternalSubset)

Function Documentation

nsresult NS_NewDOMDocumentType ( nsIDOMDocumentType **  aDocType,
nsNodeInfoManager aNodeInfoManager,
nsIPrincipal aPrincipal,
nsIAtom aName,
nsIDOMNamedNodeMap aEntities,
nsIDOMNamedNodeMap aNotations,
const nsAString &  aPublicId,
const nsAString &  aSystemId,
const nsAString &  aInternalSubset 
)

Definition at line 49 of file nsDOMDocumentType.cpp.

{
  NS_PRECONDITION(aNodeInfoManager || aPrincipal,
                  "Must have a principal if no nodeinfo manager.");
  NS_ENSURE_ARG_POINTER(aDocType);
  NS_ENSURE_ARG_POINTER(aName);

  nsresult rv;

  nsRefPtr<nsNodeInfoManager> nimgr;
  if (aNodeInfoManager) {
    nimgr = aNodeInfoManager;
  }
  else {
    nimgr = new nsNodeInfoManager();
    NS_ENSURE_TRUE(nimgr, NS_ERROR_OUT_OF_MEMORY);
    
    rv = nimgr->Init(nsnull);
    NS_ENSURE_SUCCESS(rv, rv);

    nimgr->SetDocumentPrincipal(aPrincipal);
  }

  *aDocType = new nsDOMDocumentType(nimgr, aName, aEntities, aNotations,
                                    aPublicId, aSystemId, aInternalSubset);
  if (!*aDocType) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(*aDocType);

  return NS_OK;
}

Here is the call graph for this function: