Bug 1766395 - Remove dom.forms.datetime-local prefs. r=edgar

We shipped this a while ago.

Differential Revision: https://phabricator.services.mozilla.com/D144800
This commit is contained in:
Emilio Cobos Álvarez 2022-04-27 14:10:27 +00:00
Родитель c49495fe2e
Коммит 72d2420c2b
9 изменённых файлов: 4 добавлений и 71 удалений

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

@ -5089,9 +5089,8 @@ bool HTMLInputElement::IsDateTimeTypeSupported(
switch (aDateTimeInputType) {
case FormControlType::InputDate:
case FormControlType::InputTime:
return true;
case FormControlType::InputDatetimeLocal:
return StaticPrefs::dom_forms_datetime_local();
return true;
case FormControlType::InputMonth:
case FormControlType::InputWeek:
return StaticPrefs::dom_forms_datetime_others();

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

@ -1567,8 +1567,7 @@ class HTMLInputElement final : public TextControlElement,
static bool CreatesDateTimeWidget(FormControlType aType) {
return aType == FormControlType::InputDate ||
aType == FormControlType::InputTime ||
(aType == FormControlType::InputDatetimeLocal &&
StaticPrefs::dom_forms_datetime_local_widget());
aType == FormControlType::InputDatetimeLocal;
}
bool CreatesDateTimeWidget() const { return CreatesDateTimeWidget(mType); }

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

@ -244,8 +244,6 @@ bool nsIFormControl::IsSingleLineTextControl(bool aExcludePassword,
case FormControlType::InputMonth:
case FormControlType::InputWeek:
return true;
case FormControlType::InputDatetimeLocal:
return !mozilla::StaticPrefs::dom_forms_datetime_local_widget();
case FormControlType::InputPassword:
return !aExcludePassword;
default:

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

@ -43,18 +43,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=764481
prefs: [["dom.forms.datetime.others", true]],
inputType: "week",
expectedType: "week"
}, {
prefs: [["dom.forms.datetime-local", false]],
inputType: "datetime-local",
expectedType: "text"
}, {
prefs: [["dom.forms.datetime-local", false]],
inputType: "datetime-local",
expectedType: "text"
}, {
prefs: [["dom.forms.datetime-local", true]],
inputType: "datetime-local",
expectedType: "datetime-local"
}
];

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

@ -3456,21 +3456,6 @@ nsCSSFrameConstructor::FindSearchControlData(const Element& aElement,
return &sTextControlData;
}
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindDateTimeLocalInputData(const Element& aElement,
ComputedStyle& aStyle) {
if (StaticPrefs::dom_forms_datetime_local_widget()) {
static constexpr FrameConstructionData sDateTimeData(
NS_NewDateTimeControlFrame);
return &sDateTimeData;
}
static constexpr FrameConstructionData sTextControlData(
NS_NewTextControlFrame);
return &sTextControlData;
}
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindInputData(const Element& aElement,
@ -3497,12 +3482,12 @@ nsCSSFrameConstructor::FindInputData(const Element& aElement,
SIMPLE_INT_CREATE(FormControlType::InputNumber, NS_NewNumberControlFrame),
SIMPLE_INT_CREATE(FormControlType::InputTime, NS_NewDateTimeControlFrame),
SIMPLE_INT_CREATE(FormControlType::InputDate, NS_NewDateTimeControlFrame),
SIMPLE_INT_CREATE(FormControlType::InputDatetimeLocal,
NS_NewDateTimeControlFrame),
// TODO: this is temporary until a frame is written: bug 888320
SIMPLE_INT_CREATE(FormControlType::InputMonth, NS_NewTextControlFrame),
// TODO: this is temporary until a frame is written: bug 888320
SIMPLE_INT_CREATE(FormControlType::InputWeek, NS_NewTextControlFrame),
SIMPLE_INT_CHAIN(FormControlType::InputDatetimeLocal,
FindDateTimeLocalInputData),
{int32_t(FormControlType::InputSubmit),
{ToCreationFunc(NS_NewGfxButtonControlFrame), 0,
PseudoStyleType::buttonContent}},

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

@ -1411,8 +1411,6 @@ class nsCSSFrameConstructor final : public nsFrameManager {
ComputedStyle&);
static const FrameConstructionData* FindSearchControlData(const Element&,
ComputedStyle&);
static const FrameConstructionData* FindDateTimeLocalInputData(
const Element&, ComputedStyle&);
static const FrameConstructionData* FindInputData(const Element&,
ComputedStyle&);
static const FrameConstructionData* FindObjectData(const Element&,

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

@ -2640,18 +2640,6 @@
value: @IS_NIGHTLY_BUILD@
mirror: always
# Support for input type=datetime-local.
- name: dom.forms.datetime-local
type: bool
value: true
mirror: always
# Support for input type=datetime-local widget. Disabled for now.
- name: dom.forms.datetime-local.widget
type: bool
value: true
mirror: always
# Support for input type=month, type=week. By default, disabled.
- name: dom.forms.datetime.others
type: bool

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

@ -22,7 +22,6 @@ user_pref("media.mediasource.webm.enabled", true);
user_pref("media.av1.enabled", true);
user_pref("media.eme.enabled", true);
user_pref("dom.forms.datetime.others", true);
user_pref("dom.forms.datetime-local", true);
// Enable Gamepad
user_pref("dom.gamepad.enabled", true);
user_pref("dom.gamepad.non_standard_events.enabled", true);

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

@ -786,13 +786,6 @@ add_task(async function test_datepicker_abs_max() {
* Ensure datetime-local picker closes when focus moves to a time input.
*/
add_task(async function test_datetime_focus_to_input() {
await SpecialPowers.pushPrefEnv({
set: [
["dom.forms.datetime-local", true],
["dom.forms.datetime-local.widget", true],
],
});
await helper.openPicker(
`data:text/html,<input id=datetime type=datetime-local>`
);
@ -824,13 +817,6 @@ add_task(async function test_datetime_focus_to_input() {
// Bug 1726546
add_task(async function test_datetime_local_min() {
await SpecialPowers.pushPrefEnv({
set: [
["dom.forms.datetime-local", true],
["dom.forms.datetime-local.widget", true],
],
});
const inputValue = "2016-12-15T04:00";
const inputMin = "2016-12-05T12:22";
const inputMax = "2016-12-25T12:22";
@ -894,13 +880,6 @@ add_task(async function test_datetime_local_min() {
// Bug 1726546
add_task(async function test_datetime_local_min_select_invalid() {
await SpecialPowers.pushPrefEnv({
set: [
["dom.forms.datetime-local", true],
["dom.forms.datetime-local.widget", true],
],
});
const inputValue = "2016-12-15T05:00";
const inputMin = "2016-12-05T12:22";
const inputMax = "2016-12-25T12:22";