Bug 1357002 - Part 1: Cache dom.webcomponents.customelements.enabled preference;

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-04 13:19:01 -05:00 committed by Roy Tam
commit 979d2bfb96
3 changed files with 9 additions and 1 deletions

View file

@ -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();
}

View file

@ -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);

View file

@ -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;