Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsIDocument.h File Reference
#include "nsISupports.h"
#include "nsEvent.h"
#include "nsString.h"
#include "nsCOMArray.h"
#include "nsIDocumentObserver.h"
#include "nsCOMPtr.h"
#include "nsIURI.h"
#include "nsIBindingManager.h"
#include "nsWeakPtr.h"
#include "nsIWeakReferenceUtils.h"
#include "nsILoadGroup.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "mozFlushType.h"
#include "nsPropertyTable.h"
#include "nsHashSets.h"
#include "nsAutoPtr.h"

Go to the source code of this file.

Classes

class  nsIDocument
class  nsIDocument_MOZILLA_1_8_0_BRANCH
class  nsIDocument_MOZILLA_1_8_BRANCH2
class  nsIDocument_MOZILLA_1_8_BRANCH3
class  mozAutoDocUpdate
 Helper class to automatically handle batching of document updates. More...

Defines

#define NS_IDOCUMENT_IID
#define NS_CONTENT_ID_COUNTER_BASE   10000
#define NS_STYLESHEET_FROM_CATALOG   (1 << 0)
#define NS_IDOCUMENT_MOZILLA_1_8_0_BRANCH_IID
#define NS_IDOCUMENT_MOZILLA_1_8_BRANCH2_IID
#define NS_IDOCUMENT_MOZILLA_1_8_BRANCH3_IID

Functions

nsresult NS_NewHTMLDocument (nsIDocument **aInstancePtrResult)
nsresult NS_NewXMLDocument (nsIDocument **aInstancePtrResult)
nsresult NS_NewImageDocument (nsIDocument **aInstancePtrResult)
nsresult NS_NewDocumentFragment (nsIDOMDocumentFragment **aInstancePtrResult, nsNodeInfoManager *aNodeInfoManager)
nsresult NS_NewDOMDocument_MOZILLA_1_8_BRANCH (nsIDOMDocument **aInstancePtrResult, const nsAString &aNamespaceURI, const nsAString &aQualifiedName, nsIDOMDocumentType *aDoctype, nsIURI *aBaseURI, nsIScriptGlobalObject *aScriptHandler, PRBool aLoadedAsData)
nsresult NS_NewDOMDocument (nsIDOMDocument **aInstancePtrResult, const nsAString &aNamespaceURI, const nsAString &aQualifiedName, nsIDOMDocumentType *aDoctype, nsIURI *aBaseURI)
nsresult NS_NewPluginDocument (nsIDocument **aInstancePtrResult)

Define Documentation

Definition at line 103 of file nsIDocument.h.

Value:
{ 0xd7c47f55, 0x480b, 0x4a60, \
  { 0x9a, 0xdf, 0xca, 0x49, 0x87, 0x3c, 0x71, 0xe2 } }

Definition at line 95 of file nsIDocument.h.

Value:
{ 0x7d001ad2, 0x01ac, 0x4bf2, \
  { 0xb8, 0x3a, 0x50, 0xaa, 0xed, 0xc6, 0x1d, 0xfa } }

Definition at line 845 of file nsIDocument.h.

Value:
{ 0x095024b5, 0x57d1, 0x4117, \
 { 0xb6, 0x02, 0x5c, 0x6d, 0xf2, 0x81, 0xe0, 0xba } }

Definition at line 874 of file nsIDocument.h.

Value:
{ 0x23da8ffb, 0x095d, 0x4215, \
  { 0x9a, 0x93, 0x3e, 0x0f, 0xe4, 0x10, 0x89, 0x0b } }

Definition at line 913 of file nsIDocument.h.

Definition at line 107 of file nsIDocument.h.


Function Documentation

nsresult NS_NewDocumentFragment ( nsIDOMDocumentFragment **  aInstancePtrResult,
nsNodeInfoManager aNodeInfoManager 
)

Definition at line 165 of file nsDocumentFragment.cpp.

{
  NS_ENSURE_ARG(aNodeInfoManager);

  nsCOMPtr<nsINodeInfo> nodeInfo;
  nsresult rv =
    aNodeInfoManager->GetNodeInfo(nsLayoutAtoms::documentFragmentNodeName,
                                  nsnull, kNameSpaceID_None,
                                  getter_AddRefs(nodeInfo));
  NS_ENSURE_SUCCESS(rv, rv);

  nsDocumentFragment *it = new nsDocumentFragment(nodeInfo);
  if (!it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  *aInstancePtrResult = NS_STATIC_CAST(nsIDOMDocumentFragment *, it);

  NS_ADDREF(*aInstancePtrResult);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewDOMDocument ( nsIDOMDocument **  aInstancePtrResult,
const nsAString &  aNamespaceURI,
const nsAString &  aQualifiedName,
nsIDOMDocumentType aDoctype,
nsIURI aBaseURI 
)

Definition at line 109 of file nsXMLDocument.cpp.

{
  return NS_NewDOMDocument_MOZILLA_1_8_BRANCH(aInstancePtrResult,
                                              aNamespaceURI,
                                              aQualifiedName,
                                              aDoctype,
                                              aBaseURI,
                                              nsnull,
                                              PR_FALSE);
}

Here is the call graph for this function:

nsresult NS_NewDOMDocument_MOZILLA_1_8_BRANCH ( nsIDOMDocument **  aInstancePtrResult,
const nsAString &  aNamespaceURI,
const nsAString &  aQualifiedName,
nsIDOMDocumentType aDoctype,
nsIURI aBaseURI,
nsIScriptGlobalObject aScriptHandler,
PRBool  aLoadedAsData 
)

Definition at line 125 of file nsXMLDocument.cpp.

{
  nsresult rv;

  *aInstancePtrResult = nsnull;

  nsRefPtr<nsXMLDocument> doc = new nsXMLDocument();
  if (!doc)
    return NS_ERROR_OUT_OF_MEMORY;

  rv = doc->Init();

  if (NS_FAILED(rv)) {
    return rv;
  }

  doc->SetScriptHandlingObject(aScriptHandler);
  // This is not used on 1.8 branch because of
  // https://bugzilla.mozilla.org/show_bug.cgi?id=414856
  // doc->SetLoadedAsData(aLoadedAsData);
  doc->nsIDocument::SetDocumentURI(aBaseURI);
  doc->SetBaseURI(aBaseURI);

  if (aDoctype) {
    nsCOMPtr<nsIDOMNode> tmpNode;
    rv = doc->AppendChild(aDoctype, getter_AddRefs(tmpNode));
    NS_ENSURE_SUCCESS(rv, rv);
  }
  
  if (!aQualifiedName.IsEmpty()) {
    nsCOMPtr<nsIDOMElement> root;
    rv = doc->CreateElementNS(aNamespaceURI, aQualifiedName,
                              getter_AddRefs(root));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIDOMNode> tmpNode;

    rv = doc->AppendChild(root, getter_AddRefs(tmpNode));
    NS_ENSURE_SUCCESS(rv, rv);
  }

  *aInstancePtrResult = doc;
  NS_ADDREF(*aInstancePtrResult);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewHTMLDocument ( nsIDocument **  aInstancePtrResult)

Definition at line 196 of file nsHTMLDocument.cpp.

{
  nsHTMLDocument* doc = new nsHTMLDocument();
  NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);

  NS_ADDREF(doc);
  nsresult rv = doc->Init();

  if (NS_FAILED(rv)) {
    NS_RELEASE(doc);
  }

  *aInstancePtrResult = doc;

  return rv;
}

Here is the call graph for this function:

nsresult NS_NewImageDocument ( nsIDocument **  aInstancePtrResult)

Definition at line 757 of file nsImageDocument.cpp.

{
  nsImageDocument* doc = new nsImageDocument();
  if (!doc) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(doc);
  nsresult rv = doc->Init();

  if (NS_FAILED(rv)) {
    NS_RELEASE(doc);
  }

  *aResult = doc;

  return rv;
}

Here is the call graph for this function:

nsresult NS_NewPluginDocument ( nsIDocument **  aInstancePtrResult)

Definition at line 268 of file nsPluginDocument.cpp.

{
  nsPluginDocument* doc = new nsPluginDocument();
  if (!doc) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(doc);
  nsresult rv = doc->Init();

  if (NS_FAILED(rv)) {
    NS_RELEASE(doc);
  }

  *aResult = doc;

  return rv;
}

Here is the call graph for this function:

nsresult NS_NewXMLDocument ( nsIDocument **  aInstancePtrResult)

Definition at line 180 of file nsXMLDocument.cpp.

{
  nsXMLDocument* doc = new nsXMLDocument();
  NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);

  NS_ADDREF(doc);
  nsresult rv = doc->Init();

  if (NS_FAILED(rv)) {
    NS_RELEASE(doc);
  }

  *aInstancePtrResult = doc;

  return rv;
}

Here is the call graph for this function: