From f548590e7cc71bb541c0b51a38674a6822fea4c1 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 2 Aug 2019 11:59:04 +0000 Subject: [PATCH] Bug 1570212 - Convert dom.allow_XUL_XBL_for_file to a static pref. r=mccr8 Differential Revision: https://phabricator.services.mozilla.com/D40153 --- dom/base/nsContentUtils.cpp | 7 ++----- dom/base/nsContentUtils.h | 1 - modules/libpref/init/StaticPrefList.yaml | 5 +++++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 678c90678535..821dd3d7840d 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -307,7 +307,6 @@ uint32_t nsContentUtils::sRunnersCountAtFirstBlocker = 0; nsIInterfaceRequestor* nsContentUtils::sSameOriginChecker = nullptr; bool nsContentUtils::sIsHandlingKeyBoardEvent = false; -bool nsContentUtils::sAllowXULXBL_for_file = false; nsString* nsContentUtils::sShiftText = nullptr; nsString* nsContentUtils::sControlText = nullptr; @@ -621,9 +620,6 @@ nsresult nsContentUtils::Init() { sBlockedScriptRunners = new AutoTArray, 8>; - Preferences::AddBoolVarCache(&sAllowXULXBL_for_file, - "dom.allow_XUL_XBL_for_file"); - #ifndef RELEASE_OR_BETA sBypassCSSOMOriginCheck = getenv("MOZ_BYPASS_CSSOM_ORIGIN_CHECK"); #endif @@ -6235,7 +6231,8 @@ bool nsContentUtils::AllowXULXBLForPrincipal(nsIPrincipal* aPrincipal) { aPrincipal->GetURI(getter_AddRefs(princURI)); return princURI && - ((sAllowXULXBL_for_file && SchemeIs(princURI, "file")) || + ((StaticPrefs::dom_allow_XUL_XBL_for_file() && + SchemeIs(princURI, "file")) || IsSitePermAllow(aPrincipal, NS_LITERAL_CSTRING("allowXULXBL"))); } diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index aa5d53259726..26e476cc5b13 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -3236,7 +3236,6 @@ class nsContentUtils { static nsIInterfaceRequestor* sSameOriginChecker; static bool sIsHandlingKeyBoardEvent; - static bool sAllowXULXBL_for_file; #ifndef RELEASE_OR_BETA static bool sBypassCSSOMOriginCheck; #endif diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 3f25a3459176..be0fdb0a0feb 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -1126,6 +1126,11 @@ value: true mirror: always +- name: dom.allow_XUL_XBL_for_file + type: bool + value: false + mirror: always + # Is support for automatically removing replaced filling animations enabled? - name: dom.animations-api.autoremove.enabled type: bool