Skip to content
Snippets Groups Projects
Commit 436e287a authored by Nathan Froyd's avatar Nathan Froyd
Browse files

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.
parent 0382120c
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment