mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1276669 - part 4 - initialize RDF atoms in nsLayoutStatics; r=Pike
This is not the cleanest code ever, but we need to move all static atom initialization prior to NS_SealStaticAtomTable to avoid the possibility of dynamic atoms being transmuted into static atoms. We therefore need to open up an avenue for somebody else to initialize the atoms that RDF needs.
This commit is contained in:
parent
0382120c9d
commit
436e287afe
@ -53,6 +53,7 @@
|
||||
#include "nsHtml5Atoms.h"
|
||||
#include "nsHtml5Module.h"
|
||||
#include "nsHTMLTags.h"
|
||||
#include "nsIRDFContentSink.h" // for RDF atom initialization
|
||||
#include "mozilla/dom/FallbackEncoding.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsListControlFrame.h"
|
||||
@ -164,6 +165,7 @@ nsLayoutStatics::Initialize()
|
||||
nsHtml5Atoms::AddRefAtoms();
|
||||
nsTextServicesDocument::RegisterAtoms();
|
||||
nsHTMLTags::RegisterAtoms();
|
||||
nsRDFAtoms::RegisterAtoms();
|
||||
|
||||
StartupJSEnvironment();
|
||||
rv = nsRegion::InitStatic();
|
||||
|
@ -54,4 +54,9 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFContentSink, NS_IRDFCONTENTSINK_IID)
|
||||
nsresult
|
||||
NS_NewRDFContentSink(nsIRDFContentSink** aResult);
|
||||
|
||||
class nsRDFAtoms {
|
||||
public:
|
||||
static void RegisterAtoms();
|
||||
};
|
||||
|
||||
#endif // nsIRDFContentSink_h___
|
||||
|
@ -257,6 +257,13 @@ static const nsStaticAtom rdf_atoms[] = {
|
||||
#undef RDF_ATOM
|
||||
};
|
||||
|
||||
// static
|
||||
void
|
||||
nsRDFAtoms::RegisterAtoms()
|
||||
{
|
||||
NS_RegisterStaticAtoms(rdf_atoms);
|
||||
}
|
||||
|
||||
RDFContentSinkImpl::RDFContentSinkImpl()
|
||||
: mText(nullptr),
|
||||
mTextLength(0),
|
||||
@ -287,8 +294,6 @@ RDFContentSinkImpl::RDFContentSinkImpl()
|
||||
|
||||
NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);
|
||||
rv = CallGetService(kRDFContainerUtilsCID, &gRDFContainerUtils);
|
||||
|
||||
NS_RegisterStaticAtoms(rdf_atoms);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user