Bug 1570212 - Convert dom.allow_XUL_XBL_for_file to a static pref. r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D40153
This commit is contained in:
Nicholas Nethercote
2019-08-02 11:59:04 +00:00
parent 6006d676ab
commit f548590e7c
3 changed files with 7 additions and 6 deletions

View File

@@ -307,7 +307,6 @@ uint32_t nsContentUtils::sRunnersCountAtFirstBlocker = 0;
nsIInterfaceRequestor* nsContentUtils::sSameOriginChecker = nullptr; nsIInterfaceRequestor* nsContentUtils::sSameOriginChecker = nullptr;
bool nsContentUtils::sIsHandlingKeyBoardEvent = false; bool nsContentUtils::sIsHandlingKeyBoardEvent = false;
bool nsContentUtils::sAllowXULXBL_for_file = false;
nsString* nsContentUtils::sShiftText = nullptr; nsString* nsContentUtils::sShiftText = nullptr;
nsString* nsContentUtils::sControlText = nullptr; nsString* nsContentUtils::sControlText = nullptr;
@@ -621,9 +620,6 @@ nsresult nsContentUtils::Init() {
sBlockedScriptRunners = new AutoTArray<nsCOMPtr<nsIRunnable>, 8>; sBlockedScriptRunners = new AutoTArray<nsCOMPtr<nsIRunnable>, 8>;
Preferences::AddBoolVarCache(&sAllowXULXBL_for_file,
"dom.allow_XUL_XBL_for_file");
#ifndef RELEASE_OR_BETA #ifndef RELEASE_OR_BETA
sBypassCSSOMOriginCheck = getenv("MOZ_BYPASS_CSSOM_ORIGIN_CHECK"); sBypassCSSOMOriginCheck = getenv("MOZ_BYPASS_CSSOM_ORIGIN_CHECK");
#endif #endif
@@ -6235,7 +6231,8 @@ bool nsContentUtils::AllowXULXBLForPrincipal(nsIPrincipal* aPrincipal) {
aPrincipal->GetURI(getter_AddRefs(princURI)); aPrincipal->GetURI(getter_AddRefs(princURI));
return 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"))); IsSitePermAllow(aPrincipal, NS_LITERAL_CSTRING("allowXULXBL")));
} }

View File

@@ -3236,7 +3236,6 @@ class nsContentUtils {
static nsIInterfaceRequestor* sSameOriginChecker; static nsIInterfaceRequestor* sSameOriginChecker;
static bool sIsHandlingKeyBoardEvent; static bool sIsHandlingKeyBoardEvent;
static bool sAllowXULXBL_for_file;
#ifndef RELEASE_OR_BETA #ifndef RELEASE_OR_BETA
static bool sBypassCSSOMOriginCheck; static bool sBypassCSSOMOriginCheck;
#endif #endif

View File

@@ -1126,6 +1126,11 @@
value: true value: true
mirror: always mirror: always
- name: dom.allow_XUL_XBL_for_file
type: bool
value: false
mirror: always
# Is support for automatically removing replaced filling animations enabled? # Is support for automatically removing replaced filling animations enabled?
- name: dom.animations-api.autoremove.enabled - name: dom.animations-api.autoremove.enabled
type: bool type: bool