Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsNameSpaceManager.cpp File Reference
#include "nscore.h"
#include "nsINameSpaceManager.h"
#include "nsAutoPtr.h"
#include "nsINodeInfo.h"
#include "nsCOMArray.h"
#include "nsContentCreatorFunctions.h"
#include "nsDoubleHashtable.h"
#include "nsLayoutAtoms.h"
#include "nsString.h"

Go to the source code of this file.

Classes

struct  nsNameSpaceEntry
class  nsNameSpaceHash
class  NameSpaceManagerImpl

Defines

#define kXMLNSNameSpaceURI   "http://www.w3.org/2000/xmlns/"
#define kXMLNameSpaceURI   "http://www.w3.org/XML/1998/namespace"
#define kXHTMLNameSpaceURI   "http://www.w3.org/1999/xhtml"
#define kXLinkNameSpaceURI   "http://www.w3.org/1999/xlink"
#define kXSLTNameSpaceURI   "http://www.w3.org/1999/XSL/Transform"
#define kXBLNameSpaceURI   "http://www.mozilla.org/xbl"
#define kMathMLNameSpaceURI   "http://www.w3.org/1998/Math/MathML"
#define kRDFNameSpaceURI   "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
#define kXULNameSpaceURI   "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
#define kSVGNameSpaceURI   "http://www.w3.org/2000/svg"
#define kXMLEventsNameSpaceURI   "http://www.w3.org/2001/xml-events"
#define kXHTML2UnofficialNameSpaceURI   "http://www.w3.org/TR/xhtml2"
#define kWAIRolesNameSpaceURI   "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"
#define kWAIPropertiesNameSpaceURI   "http://www.w3.org/2005/07/aaa"

Functions

nsresult NS_NewElement (nsIContent **aResult, PRInt32 aElementType, nsINodeInfo *aNodeInfo)
nsresult NS_GetNameSpaceManager (nsINameSpaceManager **aInstancePtrResult)
void NS_NameSpaceManagerShutdown ()

Variables

static NameSpaceManagerImplgNameSpaceManager = nsnull

Define Documentation

#define kMathMLNameSpaceURI   "http://www.w3.org/1998/Math/MathML"

Definition at line 64 of file nsNameSpaceManager.cpp.

#define kRDFNameSpaceURI   "http://www.w3.org/1999/02/22-rdf-syntax-ns#"

Definition at line 65 of file nsNameSpaceManager.cpp.

#define kSVGNameSpaceURI   "http://www.w3.org/2000/svg"

Definition at line 67 of file nsNameSpaceManager.cpp.

#define kWAIPropertiesNameSpaceURI   "http://www.w3.org/2005/07/aaa"

Definition at line 71 of file nsNameSpaceManager.cpp.

#define kWAIRolesNameSpaceURI   "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"

Definition at line 70 of file nsNameSpaceManager.cpp.

#define kXBLNameSpaceURI   "http://www.mozilla.org/xbl"

Definition at line 63 of file nsNameSpaceManager.cpp.

#define kXHTML2UnofficialNameSpaceURI   "http://www.w3.org/TR/xhtml2"

Definition at line 69 of file nsNameSpaceManager.cpp.

#define kXHTMLNameSpaceURI   "http://www.w3.org/1999/xhtml"

Definition at line 60 of file nsNameSpaceManager.cpp.

#define kXLinkNameSpaceURI   "http://www.w3.org/1999/xlink"

Definition at line 61 of file nsNameSpaceManager.cpp.

#define kXMLEventsNameSpaceURI   "http://www.w3.org/2001/xml-events"

Definition at line 68 of file nsNameSpaceManager.cpp.

#define kXMLNameSpaceURI   "http://www.w3.org/XML/1998/namespace"

Definition at line 59 of file nsNameSpaceManager.cpp.

#define kXMLNSNameSpaceURI   "http://www.w3.org/2000/xmlns/"

Definition at line 58 of file nsNameSpaceManager.cpp.

#define kXSLTNameSpaceURI   "http://www.w3.org/1999/XSL/Transform"

Definition at line 62 of file nsNameSpaceManager.cpp.

#define kXULNameSpaceURI   "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"

Definition at line 66 of file nsNameSpaceManager.cpp.


Function Documentation

Definition at line 329 of file nsNameSpaceManager.cpp.

{
  NS_ENSURE_ARG_POINTER(aInstancePtrResult);

  if (!gNameSpaceManager) {
    nsCOMPtr<NameSpaceManagerImpl> manager = new NameSpaceManagerImpl();
    if (manager) {
      nsresult rv = manager->Init();
      if (NS_SUCCEEDED(rv)) {
        manager.swap(gNameSpaceManager);
      }
    }
  }

  *aInstancePtrResult = gNameSpaceManager;
  NS_ENSURE_TRUE(gNameSpaceManager, NS_ERROR_OUT_OF_MEMORY);

  NS_ADDREF(*aInstancePtrResult);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 352 of file nsNameSpaceManager.cpp.

Here is the caller graph for this function:

nsresult NS_NewElement ( nsIContent **  aResult,
PRInt32  aElementType,
nsINodeInfo aNodeInfo 
)

Definition at line 244 of file nsNameSpaceManager.cpp.

{
  if (aElementType == kNameSpaceID_XHTML) {
    return NS_NewHTMLElement(aResult, aNodeInfo);
  }
#ifdef MOZ_XUL
  if (aElementType == kNameSpaceID_XUL) {
    return NS_NewXULElement(aResult, aNodeInfo);
  }
#endif
#ifdef MOZ_MATHML
  if (aElementType == kNameSpaceID_MathML) {
    return NS_NewMathMLElement(aResult, aNodeInfo);
  }
#endif
#ifdef MOZ_SVG
  if (aElementType == kNameSpaceID_SVG &&
      nsSVGUtils::SVGEnabled()) {
    return NS_NewSVGElement(aResult, aNodeInfo);
  }
#endif
  if (aElementType == kNameSpaceID_XMLEvents) {
    return NS_NewXMLEventsElement(aResult, aNodeInfo);
  }
#ifdef MOZ_XTF
  if (aElementType > kNameSpaceID_LastBuiltin) {
    nsIXTFService* xtfService = nsContentUtils::GetXTFServiceWeakRef();
    NS_ASSERTION(xtfService, "could not get xtf service");
    if (xtfService &&
        NS_SUCCEEDED(xtfService->CreateElement(aResult, aNodeInfo)))
      return NS_OK;
  }
#endif
  return NS_NewXMLElement(aResult, aNodeInfo);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 148 of file nsNameSpaceManager.cpp.