mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
Make HTML5 parser enablement use AddBoolPrefVarCache
This commit is contained in:
parent
fe65dfaaf9
commit
bbf153f97c
@ -3591,7 +3591,7 @@ nsContentUtils::CreateContextualFragment(nsIDOMNode* aContextNode,
|
||||
nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(document));
|
||||
PRBool bHTML = htmlDoc && !bCaseSensitive;
|
||||
|
||||
if (bHTML && nsContentUtils::GetBoolPref("html5.enable", PR_FALSE)) {
|
||||
if (bHTML && nsHtml5Module::Enabled) {
|
||||
// See if the document has a cached fragment parser. nsHTMLDocument is the
|
||||
// only one that should really have one at the moment.
|
||||
nsCOMPtr<nsIParser> parser = document->GetFragmentParser();
|
||||
|
@ -655,7 +655,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
||||
PRBool aReset,
|
||||
nsIContentSink* aSink)
|
||||
{
|
||||
PRBool loadAsHtml5 = nsContentUtils::GetBoolPref("html5.enable", PR_FALSE);
|
||||
PRBool loadAsHtml5 = nsHtml5Module::Enabled;
|
||||
if (aSink) {
|
||||
loadAsHtml5 = PR_FALSE;
|
||||
}
|
||||
@ -1805,7 +1805,7 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
PRBool loadAsHtml5 = nsContentUtils::GetBoolPref("html5.enable", PR_FALSE);
|
||||
PRBool loadAsHtml5 = nsHtml5Module::Enabled;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -47,6 +47,7 @@ class nsHtml5Module
|
||||
static void ReleaseStatics();
|
||||
static already_AddRefed<nsIParser> NewHtml5Parser();
|
||||
static nsresult Initialize(nsIParser* aParser, nsIDocument* aDoc, nsIURI* aURI, nsISupports* aContainer, nsIChannel* aChannel);
|
||||
static PRBool Enabled;
|
||||
#ifdef DEBUG
|
||||
private:
|
||||
static PRBool sNsHtml5ModuleInitialized;
|
||||
|
@ -35,6 +35,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsHtml5AttributeName.h"
|
||||
#include "nsHtml5ElementName.h"
|
||||
#include "nsHtml5HtmlAttributes.h"
|
||||
@ -47,10 +48,13 @@
|
||||
|
||||
#include "nsHtml5Module.h"
|
||||
|
||||
PRBool nsHtml5Module::Enabled = PR_FALSE;
|
||||
|
||||
// static
|
||||
void
|
||||
nsHtml5Module::InitializeStatics()
|
||||
{
|
||||
nsContentUtils::AddBoolPrefVarCache("html5.enable", &Enabled);
|
||||
nsHtml5Atoms::AddRefAtoms();
|
||||
nsHtml5AttributeName::initializeStatics();
|
||||
nsHtml5ElementName::initializeStatics();
|
||||
|
Loading…
Reference in New Issue
Block a user