summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
Diffstat (limited to 'dom')
-rw-r--r--dom/base/CustomElementRegistry.cpp2
-rw-r--r--dom/base/nsContentUtils.cpp4
-rw-r--r--dom/base/nsContentUtils.h4
3 files changed, 9 insertions, 1 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index 1743779f0..75477dbaa 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -171,7 +171,7 @@ NS_INTERFACE_MAP_END
/* static */ bool
CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
{
- return Preferences::GetBool("dom.webcomponents.customelements.enabled") ||
+ return nsContentUtils::IsCustomElementsEnabled() ||
nsContentUtils::IsWebComponentsEnabled();
}
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index dd6835e57..b8ee09bf6 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -285,6 +285,7 @@ bool nsContentUtils::sIsPerformanceNavigationTimingEnabled = false;
bool nsContentUtils::sIsUserTimingLoggingEnabled = false;
bool nsContentUtils::sIsExperimentalAutocompleteEnabled = false;
bool nsContentUtils::sIsWebComponentsEnabled = false;
+bool nsContentUtils::sIsCustomElementsEnabled = false;
bool nsContentUtils::sEncodeDecodeURLHash = false;
bool nsContentUtils::sGettersDecodeURLHash = false;
bool nsContentUtils::sPrivacyResistFingerprinting = false;
@@ -588,6 +589,9 @@ nsContentUtils::Init()
Preferences::AddBoolVarCache(&sIsWebComponentsEnabled,
"dom.webcomponents.enabled", false);
+ Preferences::AddBoolVarCache(&sIsCustomElementsEnabled,
+ "dom.webcomponents.customelements.enabled", false);
+
Preferences::AddBoolVarCache(&sEncodeDecodeURLHash,
"dom.url.encode_decode_hash", false);
diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h
index 80f26c2b0..06a7b5ded 100644
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -2746,6 +2746,9 @@ public:
static bool
IsWebComponentsEnabled() { return sIsWebComponentsEnabled; }
+ static bool
+ IsCustomElementsEnabled() { return sIsCustomElementsEnabled; }
+
private:
static bool InitializeEventTable();
@@ -2854,6 +2857,7 @@ private:
static bool sIsFrameTimingPrefEnabled;
static bool sIsExperimentalAutocompleteEnabled;
static bool sIsWebComponentsEnabled;
+ static bool sIsCustomElementsEnabled;
static bool sEncodeDecodeURLHash;
static bool sGettersDecodeURLHash;
static bool sPrivacyResistFingerprinting;