kContainerContentsGeneratedAtom = NS_NewAtom("containercontentsgenerated");
kCommandUpdaterAtom             = NS_NewAtom("commandupdater"); kEventsAtom                     = NS_NewAtom("events");
XULDocumentImpl::XULDocumentImpl(void)    : mParentDocument(nsnull),      mScriptContextOwner(nsnull),      mScriptObject(nsnull),      mCharSetID("UTF-8"),      mDisplaySelection(PR_FALSE),      mContentViewerContainer(nsnull),      mParentContentSink(nsnull),      mIsPopup(PR_FALSE){    NS_INIT_REFCNT();    nsresult rv;    // construct a selection object/*    if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRangeListCID,                                                    nsnull,                                                    kIDOMSelectionIID,                                                    (void**) &mSelection))) {        NS_ERROR("unable to create DOM selection");    }*/    if (gRefCnt++ == 0) {        kContainerContentsGeneratedAtom = NS_NewAtom("containercontentsgenerated");        kIdAtom                         = NS_NewAtom("id");        kObservesAtom                   = NS_NewAtom("observes");        kOpenAtom                       = NS_NewAtom("open");        kPersistAtom                    = NS_NewAtom("persist");        kRefAtom                        = NS_NewAtom("ref");        kRuleAtom                       = NS_NewAtom("rule");        kTemplateAtom                   = NS_NewAtom("template");        kTemplateContentsGeneratedAtom  = NS_NewAtom("templatecontentsgenerated");        kXULContentsGeneratedAtom       = NS_NewAtom("xulcontentsgenerated");        // Keep the RDF service cached in a member variable to make using        // it a bit less painful        rv = nsServiceManager::GetService(kRDFServiceCID,                                          kIRDFServiceIID,                                          (nsISupports**) &gRDFService);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF Service");        if (gRDFService) {            gRDFService->GetResource(kURIRDF_instanceOf, &kRDF_instanceOf);            gRDFService->GetResource(kURIRDF_type,       &kRDF_type);            gRDFService->GetResource(kURIXUL_element,    &kXUL_element);        }        rv = nsServiceManager::GetService(kNameSpaceManagerCID,                                          nsCOMTypeInfo<nsINameSpaceManager>::GetIID(),                                          (nsISupports**) &gNameSpaceManager);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get namespace manager");#define XUL_NAMESPACE_URI "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"static const char kXULNameSpaceURI[] = XUL_NAMESPACE_URI;        gNameSpaceManager->RegisterNameSpace(kXULNameSpaceURI, kNameSpaceID_XUL);        rv = nsServiceManager::GetService(kXULContentUtilsCID,                                          nsCOMTypeInfo<nsIXULContentUtils>::GetIID(),                                          (nsISupports**) &gXULUtils);    }#ifdef PR_LOGGING    if (! gMapLog)        gMapLog = PR_NewLogModule("nsXULDocumentElementMap");    if (! gXULLog)        gXULLog = PR_NewLogModule("nsXULDocument");#endif}