Bug 1548253 - Port pref cache variables of nsContentUtils to StaticPrefs - dom.forms.autocomplete.formautofill, r=Ehsan

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2019-05-01 21:09:05 +00:00
Родитель dc41e899af
Коммит aeb75d8ede
4 изменённых файлов: 11 добавлений и 10 удалений

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

@ -310,7 +310,6 @@ nsString* nsContentUtils::sAltText = nullptr;
nsString* nsContentUtils::sModifierSeparator = nullptr;
bool nsContentUtils::sInitialized = false;
bool nsContentUtils::sIsFormAutofillAutocompleteEnabled = false;
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
bool nsContentUtils::sUseActivityCursor = false;
bool nsContentUtils::sAnimationsAPICoreEnabled = false;
@ -624,9 +623,6 @@ nsresult nsContentUtils::Init() {
Preferences::AddBoolVarCache(&sAllowXULXBL_for_file,
"dom.allow_XUL_XBL_for_file");
Preferences::AddBoolVarCache(&sIsFormAutofillAutocompleteEnabled,
"dom.forms.autocomplete.formautofill", false);
Preferences::AddIntVarCache(&sPrivacyMaxInnerWidth,
"privacy.window.maxInnerWidth", 1000);
@ -1088,7 +1084,8 @@ nsContentUtils::InternalSerializeAutocompleteAttribute(
// Only allow on/off if form autofill @autocomplete values aren't enabled
// and it doesn't grant all valid values.
if (!sIsFormAutofillAutocompleteEnabled && !aGrantAllValidValue) {
if (!StaticPrefs::dom_forms_autocomplete_formautofill() &&
!aGrantAllValidValue) {
return eAutocompleteAttrState_Invalid;
}
@ -1100,7 +1097,8 @@ nsContentUtils::InternalSerializeAutocompleteAttribute(
} else { // Check if the last token is of the contact category instead.
// Only allow on/off if form autofill @autocomplete values aren't enabled
// and it doesn't grant all valid values.
if (!sIsFormAutofillAutocompleteEnabled && !aGrantAllValidValue) {
if (!StaticPrefs::dom_forms_autocomplete_formautofill() &&
!aGrantAllValidValue) {
return eAutocompleteAttrState_Invalid;
}

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

@ -3461,7 +3461,6 @@ class nsContentUtils {
static bool sIsHandlingKeyBoardEvent;
static bool sAllowXULXBL_for_file;
static uint32_t sHandlingInputTimeout;
static bool sIsFormAutofillAutocompleteEnabled;
static bool sSendPerformanceTimingNotifications;
static bool sUseActivityCursor;
static bool sAnimationsAPICoreEnabled;

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

@ -634,6 +634,13 @@ VARCACHE_PREF(
bool, true
)
// Support @autocomplete values for form autofill feature.
VARCACHE_PREF(
"dom.forms.autocomplete.formautofill",
dom_forms_autocomplete_formautofill,
bool, false
)
//---------------------------------------------------------------------------
// Extension prefs
//---------------------------------------------------------------------------

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

@ -1365,9 +1365,6 @@ pref("dom.forms.datetime.others", false);
// Enable time picker UI. By default, disabled.
pref("dom.forms.datetime.timepicker", false);
// Support @autocomplete values for form autofill feature.
pref("dom.forms.autocomplete.formautofill", false);
// Enable search in <select> dropdowns (more than 40 options)
pref("dom.forms.selectSearch", false);
// Allow for webpages to provide custom styling for <select>