Bug 1357191 - 1. Use Gecko controls for Fennec date/time fields; r=jessica r=nechen

Right now, date/time fields in Fennec appear as regular text fields,
which display the date/time values without formatting. This patch makes
the fields use the Gecko controls, which do support formatting. This
only changes the appearance of the fields; we still display the native
date/time pickers when the fields are tapped on. The reset button is
hidden in the controls because the Fennec date/time picker provides
a separate "clear" button.

MozReview-Commit-ID: EBE2U1zL74Q
This commit is contained in:
Jim Chen 2017-10-10 12:15:50 -04:00
Родитель 4108272f1d
Коммит ee5f9c3e19
4 изменённых файлов: 6 добавлений и 12 удалений

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

@ -289,11 +289,6 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
aType == NS_FORM_INPUT_TEL ||
aType == NS_FORM_INPUT_URL ||
// TODO: those are temporary until bug 773205 is fixed.
#if defined(MOZ_WIDGET_ANDROID)
// On Android/B2G, date/time input appears as a normal text box.
aType == NS_FORM_INPUT_TIME ||
aType == NS_FORM_INPUT_DATE ||
#endif
aType == NS_FORM_INPUT_MONTH ||
aType == NS_FORM_INPUT_WEEK ||
aType == NS_FORM_INPUT_DATETIME_LOCAL ||

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

@ -3819,14 +3819,8 @@ nsCSSFrameConstructor::FindInputData(Element* aElement,
nsCSSAnonBoxes::buttonContent) },
// TODO: this is temporary until a frame is written: bug 635240.
SIMPLE_INT_CREATE(NS_FORM_INPUT_NUMBER, NS_NewNumberControlFrame),
#if defined(MOZ_WIDGET_ANDROID)
// On Android, date/time input appears as a normal text box.
SIMPLE_INT_CREATE(NS_FORM_INPUT_TIME, NS_NewTextControlFrame),
SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewTextControlFrame),
#else
SIMPLE_INT_CREATE(NS_FORM_INPUT_TIME, NS_NewDateTimeControlFrame),
SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewDateTimeControlFrame),
#endif
// TODO: this is temporary until a frame is written: bug 888320
SIMPLE_INT_CREATE(NS_FORM_INPUT_MONTH, NS_NewTextControlFrame),
// TODO: this is temporary until a frame is written: bug 888320

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

@ -181,7 +181,8 @@ pref("browser.formfill.enable", true);
pref("layout.spellcheckDefault", 0);
/* new html5 forms */
pref("dom.experimental_forms", true);
pref("dom.forms.datetime", true);
pref("dom.forms.datetime.others", true);
pref("dom.forms.number", true);
/* extension manager and xpinstall */

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

@ -301,6 +301,10 @@ input[type=number]::-moz-number-spin-box {
display: none;
}
button:-moz-native-anonymous.datetime-reset-button {
display: none;
}
/* Override accessiblecaret css in layout/style/ua.css */
div:-moz-native-anonymous.moz-accessiblecaret > #text-overlay,
div:-moz-native-anonymous.moz-accessiblecaret > #image {