kIdAtom          = NS_NewAtom("id"); kRefAtom         = NS_NewAtom("ref"); kClassAtom       = NS_NewAtom("class"); kStyleAtom       = NS_NewAtom("style"); kTreeAtom        = NS_NewAtom("tree"); kTreeItemAtom    = NS_NewAtom("treeitem"); kTreeRowAtom     = NS_NewAtom("treerow"); kTreeCellAtom    = NS_NewAtom("treecell"); kTreeChildrenAtom = NS_NewAtom("treechildren"); kTreeColAtom     = NS_NewAtom("treecol"); kSelectedAtom    = NS_NewAtom("selected"); kTitledButtonAtom = NS_NewAtom("titledbutton"); kPopupAtom       = NS_NewAtom("popup"); kTooltipAtom     = NS_NewAtom("tooltip"); kContextAtom     = NS_NewAtom("context"); kObservesAtom    = NS_NewAtom("observes"); kXULContentsGeneratedAtom = NS_NewAtom("xulcontentsgenerated");
kClassAtom          = NS_NewAtom("class"); kContextAtom        = NS_NewAtom("context"); kIdAtom             = NS_NewAtom("id"); kObservesAtom       = NS_NewAtom("observes"); kPopupAtom          = NS_NewAtom("popup"); kRefAtom            = NS_NewAtom("ref"); kSelectedAtom       = NS_NewAtom("selected"); kStyleAtom          = NS_NewAtom("style"); kTitledButtonAtom   = NS_NewAtom("titledbutton"); kTooltipAtom        = NS_NewAtom("tooltip"); kTreeAtom           = NS_NewAtom("tree"); kTreeCellAtom       = NS_NewAtom("treecell"); kTreeChildrenAtom   = NS_NewAtom("treechildren"); kTreeColAtom        = NS_NewAtom("treecol"); kTreeItemAtom       = NS_NewAtom("treeitem"); kTreeRowAtom        = NS_NewAtom("treerow");
RDFElementImpl::RDFElementImpl(PRInt32 aNameSpaceID, nsIAtom* aTag)    : mDocument(nsnull),      mScriptObject(nsnull),      mChildren(nsnull),      mParent(nsnull),      mNameSpaceID(aNameSpaceID),      mTag(aTag),      mListenerManager(nsnull),      mAttributes(nsnull),      mBroadcastListeners(nsnull),      mBroadcaster(nsnull),      mInnerXULElement(nsnull),      mLazyState(0){    NS_INIT_REFCNT();    NS_ADDREF(aTag);    if (gRefCnt++ == 0) {        nsresult rv;        rv = nsServiceManager::GetService(kRDFServiceCID,                                          kIRDFServiceIID,                                          (nsISupports**) &gRDFService);        NS_VERIFY(NS_SUCCEEDED(rv), "unable to get RDF service");        kIdAtom          = NS_NewAtom("id");        kRefAtom         = NS_NewAtom("ref");        kClassAtom       = NS_NewAtom("class");        kStyleAtom       = NS_NewAtom("style");        kTreeAtom        = NS_NewAtom("tree");        kTreeItemAtom    = NS_NewAtom("treeitem");        kTreeRowAtom     = NS_NewAtom("treerow");        kTreeCellAtom    = NS_NewAtom("treecell");        kTreeChildrenAtom = NS_NewAtom("treechildren");        kTreeColAtom     = NS_NewAtom("treecol");        kSelectedAtom    = NS_NewAtom("selected");        kTitledButtonAtom = NS_NewAtom("titledbutton");        kPopupAtom       = NS_NewAtom("popup");        kTooltipAtom     = NS_NewAtom("tooltip");        kContextAtom     = NS_NewAtom("context");        kObservesAtom    = NS_NewAtom("observes");        kXULContentsGeneratedAtom = NS_NewAtom("xulcontentsgenerated");        EventHandlerMapEntry* entry = kEventHandlerMap;        while (entry->mAttributeName) {            entry->mAttributeAtom = NS_NewAtom(entry->mAttributeName);            ++entry;        }        rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,                                                nsnull,                                                kINameSpaceManagerIID,                                                (void**) &gNameSpaceManager);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create namespace manager");        if (gNameSpaceManager) {            gNameSpaceManager->RegisterNameSpace(kRDFNameSpaceURI, kNameSpaceID_RDF);            gNameSpaceManager->RegisterNameSpace(kXULNameSpaceURI, kNameSpaceID_XUL);        }        rv = nsServiceManager::GetService(kXULContentUtilsCID,                                          nsCOMTypeInfo<nsIXULContentUtils>::GetIID(),                                          (nsISupports**) &gXULUtils);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get XUL content utils");    }}