Bug 1276669 - part 1 - make nsHtml5Atoms initialization explicit in nsLayoutStatics; r=hsivonen

Moving the html5 atoms out into their own initialization phase makes the
initialization of atoms more explicit and avoids problems with trying to
move modules around so their atoms get initialized in the correct place.
As an aesthetic bonus, this change produces pleasing symmetry in
nsHtml5Module::{Initialize,Release}Statics.

Reviewed-by: Nathan Froyd <froydnj@mozilla.com>
This commit is contained in:
Nathan Froyd 2017-01-26 15:43:39 -05:00
parent bc88abc700
commit 68792e7375
2 changed files with 2 additions and 1 deletions

View File

@ -50,6 +50,7 @@
#include "nsCSSRuleProcessor.h"
#include "nsCORSListenerProxy.h"
#include "nsHTMLDNSPrefetch.h"
#include "nsHtml5Atoms.h"
#include "nsHtml5Module.h"
#include "mozilla/dom/FallbackEncoding.h"
#include "nsFocusManager.h"
@ -159,6 +160,7 @@ nsLayoutStatics::Initialize()
nsCSSProps::AddRefTable();
nsColorNames::AddRefTable();
nsGkAtoms::AddRefAtoms();
nsHtml5Atoms::AddRefAtoms();
StartupJSEnvironment();
rv = nsRegion::InitStatic();

View File

@ -30,7 +30,6 @@ void
nsHtml5Module::InitializeStatics()
{
Preferences::AddBoolVarCache(&sOffMainThread, "html5.offmainthread");
nsHtml5Atoms::AddRefAtoms();
nsHtml5AttributeName::initializeStatics();
nsHtml5ElementName::initializeStatics();
nsHtml5HtmlAttributes::initializeStatics();