Bug 1541233 - Don't load customization style sheets if toolkit.legacyUserProfileCustomizations.stylesheets pref is not set. r=mconley,emilio

Differential Revision: https://phabricator.services.mozilla.com/D31670

--HG--
extra : moz-landing-system : lando
This commit is contained in:
mandy cheang 2019-05-23 12:06:09 +00:00
Родитель 05a97e08e4
Коммит 5767663a4e
3 изменённых файлов: 6 добавлений и 25 удалений

Просмотреть файл

@ -289,16 +289,6 @@ const startupPhases = {
read: 3,
close: 3,
},
{
path: "UChrm:userChrome.css",
condition: WIN,
stat: 1,
},
{ // bug 1541233
path: "UChrm:userContent.css",
condition: WIN,
stat: 1,
},
{ // bug 1541246
path: "XREUSysExt:",
condition: WIN,

Просмотреть файл

@ -416,6 +416,10 @@ nsLayoutStylesheetCache* nsLayoutStylesheetCache::Singleton() {
}
void nsLayoutStylesheetCache::InitFromProfile() {
if (!Preferences::GetBool(PREF_LEGACY_STYLESHEET_CUSTOMIZATION)) {
return;
}
nsCOMPtr<nsIXULRuntime> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
if (appInfo) {
@ -444,21 +448,6 @@ void nsLayoutStylesheetCache::InitFromProfile() {
eLogToConsole);
if (XRE_IsParentProcess()) {
if (mUserChromeSheet || mUserContentSheet) {
// Bug 1541233 aims to avoid stat'ing or loading userContent.css or
// userChrome.css during start-up by default. After that point,
// PREF_LEGACY_STYLESHEET_CUSTOMIZATION pref is how users can opt-in
// to continuing to use userChrome.css or userContent.css.
//
// Before bug 1541233 lands though, we'll ship a release which
// continues to look for those files on start-up and sets a pref.
// That way, in a subsequent release when loading those files is
// off by default, those users will still get their userChrome.css
// and userContent.css customizations without having to manually
// set the pref themselves.
Preferences::SetBool(PREF_LEGACY_STYLESHEET_CUSTOMIZATION, true);
}
// We're interested specifically in potential chrome customizations,
// so we only need data points from the parent process
Telemetry::Accumulate(Telemetry::USER_CHROME_CSS_LOADED,

Просмотреть файл

@ -103,3 +103,5 @@ user_pref("ui.systemUsesDarkTheme", 0);
user_pref("dom.push.serverURL", "");
// Disable intermittent telemetry collection
user_pref("toolkit.telemetry.initDelay", 99999999);
// Setting this pref to true for usercss reftests, since it relies on userContent.css
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);