author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Tue, 10 Oct 2017 23:27:21 +0200 | |
changeset 385378 | ec3952ef5411c6b24d181bc6eaf0b35a2cb280fd |
parent 385377 | 412da89cc8e754831e6942b55d3cfd0ea3f1c88b |
child 385379 | 3aad26ddfedf4f2765b121d0aa9032b55c01076c |
push id | 96003 |
push user | archaeopteryx@coole-files.de |
push date | Tue, 10 Oct 2017 21:27:32 +0000 |
treeherder | mozilla-inbound@ec3952ef5411 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | backout |
bugs | 1357191 |
milestone | 58.0a1 |
backs out | c6ba568874b01e46deb494b75002edeb9892f9dc 562e7fc9a839036603bd039f13860dc637afa6fa |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/html/nsIFormControl.h +++ b/dom/html/nsIFormControl.h @@ -284,16 +284,21 @@ bool nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType) { return aType == NS_FORM_INPUT_TEXT || aType == NS_FORM_INPUT_EMAIL || aType == NS_FORM_INPUT_SEARCH || 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 || (!aExcludePassword && aType == NS_FORM_INPUT_PASSWORD); } bool nsIFormControl::IsSubmittableControl() const
--- a/dom/html/test/forms/mochitest.ini +++ b/dom/html/test/forms/mochitest.ini @@ -28,22 +28,29 @@ skip-if = os == "android" # up/down arro [test_input_autocomplete.html] [test_input_color_input_change_events.html] [test_input_color_picker_initial.html] [test_input_color_picker_popup.html] skip-if = android_version == '18' # Android, bug 1147974 [test_input_color_picker_update.html] skip-if = android_version == '18' # Android, bug 1147974 [test_input_date_bad_input.html] +skip-if = os == "android" [test_input_date_key_events.html] +skip-if = os == "android" [test_input_datetime_input_change_events.html] +skip-if = os == "android" [test_input_datetime_focus_blur.html] +skip-if = os == "android" [test_input_datetime_focus_blur_events.html] +skip-if = os == "android" [test_input_datetime_focus_state.html] +skip-if = os == "android" [test_input_datetime_tabindex.html] +skip-if = os == "android" [test_input_defaultValue.html] [test_input_email.html] [test_input_event.html] skip-if = android_version == '18' # bug 1147974 [test_input_file_picker.html] [test_input_list_attribute.html] [test_input_number_l10n.html] # We don't build ICU for Firefox for Android: @@ -61,17 +68,19 @@ skip-if = os == "android" [test_input_range_attr_order.html] [test_input_range_key_events.html] [test_input_range_mouse_and_touch_events.html] [test_input_range_mozinputrangeignorepreventdefault.html] [test_input_range_rounding.html] [test_input_sanitization.html] [test_input_textarea_set_value_no_scroll.html] [test_input_time_key_events.html] +skip-if = os == "android" [test_input_time_sec_millisec_field.html] +skip-if = os == "android" [test_input_types_pref.html] [test_input_typing_sanitization.html] skip-if = os == "android" && debug # bug 1397615 [test_input_untrusted_key_events.html] [test_input_url.html] [test_interactive_content_in_label.html] [test_label_control_attribute.html] [test_label_input_controls.html]
--- a/dom/html/test/forms/test_input_date_bad_input.html +++ b/dom/html/test/forms/test_input_date_bad_input.html @@ -32,17 +32,16 @@ SimpleTest.waitForExplicitFinish(); SimpleTest.waitForFocus(function() { SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, function() { test(); SimpleTest.finish(); }); }); const DATE_BAD_INPUT_MSG = "Please enter a valid date."; -const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent); function checkValidity(aElement, aIsBadInput) { is(aElement.validity.valid, aIsBadInput ? false : true, "validity.valid should be " + (aIsBadInput ? "false" : "true")); is(aElement.validity.badInput, aIsBadInput ? true : false, "validity.badInput should be " + (aIsBadInput ? "true" : "false")); is(aElement.validationMessage, aIsBadInput ? DATE_BAD_INPUT_MSG : "", "validationMessage should be: " + (aIsBadInput ? DATE_BAD_INPUT_MSG : "")); @@ -89,20 +88,17 @@ function test() { elem.blur(); checkValidity(elem, false); elem.focus(); sendKeys("02292017"); elem.blur(); checkValidity(elem, true); - // Reset button is desktop only. - if (isDesktop) { - // Clearing all fields should clear bad input validity state as well. - synthesizeMouse(input, resetButton_X, resetButton_Y, {}); - checkValidity(elem, false); - } + // Clearing all fields should clear bad input validity state as well. + synthesizeMouse(input, resetButton_X, resetButton_Y, {}); + checkValidity(elem, false); } </script> </pre> </body> </html>
--- a/dom/html/test/forms/test_input_datetime_input_change_events.html +++ b/dom/html/test/forms/test_input_datetime_input_change_events.html @@ -21,18 +21,16 @@ https://bugzilla.mozilla.org/show_bug.cg <pre id="test"> <script class="testbody" type="text/javascript"> /** * Test for Bug 1370858. * Test that change and input events are (not) fired for date/time inputs. **/ -const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent); - var inputTypes = ["time", "date"]; var changeEvents = [0, 0]; var inputEvents = [0, 0]; var values = ["10:30", "2017-06-08"]; var expectedValues = [["09:30", "01:30"], ["2017-05-08", "2017-01-08"]]; SimpleTest.waitForExplicitFinish(); SimpleTest.waitForFocus(function() { @@ -70,24 +68,21 @@ function test() { // Test that change and input events are fired when changing the value with // the keyboard. synthesizeKey("0", {}); synthesizeKey("1", {}); is(input.value, expectedValues[i][1], "Check that value was set correctly (2)."); is(changeEvents[i], 2, "Change event should be dispatched (2)."); is(inputEvents[i], 2, "Input event should be dispatched (2)."); - // Reset button is desktop only. - if (isDesktop) { - // Test that change and input events are fired when clearing the value using - // the reset button. - synthesizeMouse(input, resetButton_X, resetButton_Y, {}); - is(input.value, "", "Check that value was set correctly (3)."); - is(changeEvents[i], 3, "Change event should be dispatched (3)."); - is(inputEvents[i], 3, "Input event should be dispatched (3)."); - } + // Test that change and input events are fired when clearing the value using + // the reset button. + synthesizeMouse(input, resetButton_X, resetButton_Y, {}); + is(input.value, "", "Check that value was set correctly (3)."); + is(changeEvents[i], 3, "Change event should be dispatched (3)."); + is(inputEvents[i], 3, "Input event should be dispatched (3)."); } } </script> </pre> </body> </html>
--- a/dom/html/test/forms/test_input_sanitization.html +++ b/dom/html/test/forms/test_input_sanitization.html @@ -13,17 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg <p id="display"></p> <pre id="test"> <div id='content'> <form> </form> </div> <script type="application/javascript"> -SimpleTest.requestLongerTimeout(4); +SimpleTest.requestLongerTimeout(2); /** * This files tests the 'value sanitization algorithm' for the various input * types. Note that an input's value is affected by more than just its type's * value sanitization algorithm; e.g. some type=range has actions that the user * agent must perform to change the element's value to avoid underflow/overflow * and step mismatch (when possible). We specifically avoid triggering these * other actions here so that this test only tests the value sanitization
--- a/dom/html/test/forms/test_input_typing_sanitization.html +++ b/dom/html/test/forms/test_input_typing_sanitization.html @@ -20,16 +20,17 @@ https://bugzilla.mozilla.org/show_bug.cg </div> <pre id="test"> <script type="application/javascript"> /* * This test checks that when a user types in some input types, it will not be * in a state where the value will be un-sanitized and usable (by a script). */ +const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent); var input = document.getElementById('i'); var form = document.getElementById('f'); var submitFrame = document.getElementsByTagName('iframe')[0]; var testData = []; var gCurrentTest = null; var gValidData = []; var gInvalidData = []; @@ -132,16 +133,57 @@ function* runTest() "e", "e2", "1e0.1", "foo", "42,13", // comma can't be used as a decimal separator ] }, { + mobileOnly: true, + type: 'date', + validData: [ + '0001-01-01', + '2012-12-21', + '2013-01-28', + '100000-01-01', + ], + invalidData: [ + '1-01-01', + 'a', + '-', + '2012-01', + '2013-01-1', + '1011-23-21', + '1000-12-99', + ] + }, + { + mobileOnly: true, + type: 'time', + validData: [ + '00:00', + '09:09:00', + '08:23:23.1', + '21:43:56.12', + '23:12:45.100', + ], + invalidData: [ + '00:', + '00:00:', + '25:00', + '-00:00', + '00:00:00.', + '00:60', + '10:58:99', + ':19:10', + '23:08:09.1012', + ] + }, + { type: 'month', validData: [ '0001-01', '2012-12', '100000-01', ], invalidData: [ '1-01', @@ -189,16 +231,20 @@ function* runTest() 'datetime-local' ] }, ]; for (test of data) { gCurrentTest = test; + if (gCurrentTest.mobileOnly && isDesktop) { + continue; + } + input.type = test.type; gValidData = test.validData; gInvalidData = test.invalidData; for (data of gValidData) { input.value = ""; input.focus(); sendString(data);
--- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3814,18 +3814,24 @@ nsCSSFrameConstructor::FindInputData(Ele SIMPLE_INT_CREATE(NS_FORM_INPUT_URL, NS_NewTextControlFrame), SIMPLE_INT_CREATE(NS_FORM_INPUT_RANGE, NS_NewRangeFrame), SIMPLE_INT_CREATE(NS_FORM_INPUT_PASSWORD, NS_NewTextControlFrame), { NS_FORM_INPUT_COLOR, FCDATA_WITH_WRAPPING_BLOCK(0, NS_NewColorControlFrame, 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 SIMPLE_INT_CREATE(NS_FORM_INPUT_WEEK, NS_NewTextControlFrame), // TODO: this is temporary until a frame is written: bug 888320 SIMPLE_INT_CREATE(NS_FORM_INPUT_DATETIME_LOCAL, NS_NewTextControlFrame), { NS_FORM_INPUT_SUBMIT, FCDATA_WITH_WRAPPING_BLOCK(0, NS_NewGfxButtonControlFrame,
--- a/layout/reftests/forms/input/datetime/reftest.list +++ b/layout/reftests/forms/input/datetime/reftest.list @@ -1,21 +1,24 @@ default-preferences pref(dom.forms.datetime,true) -!= time-simple-unthemed.html time-simple-unthemed-ref.html -!= time-large-font.html time-basic.html -!= time-width-height.html time-basic.html -!= time-border.html time-basic.html +# not valid on Android where type=time looks like type=text +skip-if(Android) != time-simple-unthemed.html time-simple-unthemed-ref.html +skip-if(Android) != time-large-font.html time-basic.html +skip-if(Android) != time-width-height.html time-basic.html +skip-if(Android) != time-border.html time-basic.html +# only valid on Android where type=number looks the same as type=text +skip-if(!Android) == time-simple-unthemed.html time-simple-unthemed-ref.html # type change -== to-time-from-other-type-unthemed.html time-simple-unthemed.html -== from-time-to-other-type-unthemed.html from-time-to-other-type-unthemed-ref.html +skip-if(Android) == to-time-from-other-type-unthemed.html time-simple-unthemed.html +skip-if(Android) == from-time-to-other-type-unthemed.html from-time-to-other-type-unthemed-ref.html # content should not overflow on small width/height -== time-small-width.html time-small-width-ref.html -== time-small-height.html time-small-height-ref.html -== time-small-width-height.html time-small-width-height-ref.html +skip-if(Android) == time-small-width.html time-small-width-ref.html +skip-if(Android) == time-small-height.html time-small-height-ref.html +skip-if(Android) == time-small-width-height.html time-small-width-height-ref.html # content (text) should be left aligned -fuzzy-if(Android,4,8) == time-content-left-aligned.html time-content-left-aligned-ref.html +skip-if(Android) == time-content-left-aligned.html time-content-left-aligned-ref.html # reset button should be right aligned skip-if(Android) == time-reset-button-right-aligned.html time-reset-button-right-aligned-ref.html # bug 1372062
--- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -176,18 +176,17 @@ pref("findhelper.autozoom", true); /* autocomplete */ pref("browser.formfill.enable", true); /* spellcheck */ pref("layout.spellcheckDefault", 0); /* new html5 forms */ -pref("dom.forms.datetime", true); -pref("dom.forms.datetime.others", true); +pref("dom.experimental_forms", true); pref("dom.forms.number", true); /* extension manager and xpinstall */ pref("xpinstall.whitelist.directRequest", false); pref("xpinstall.whitelist.fileRequest", false); pref("xpinstall.whitelist.add", "https://addons.mozilla.org,https://testpilot.firefox.com"); pref("xpinstall.signatures.required", true);
--- a/mobile/android/themes/geckoview/content.css +++ b/mobile/android/themes/geckoview/content.css @@ -296,20 +296,16 @@ input[type="submit"]:active:hover { padding-inline-start: 7px; } input[type=number] > div > div, /* work around bug 946184 */ 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 { /* border: 0.1px solid red; */ /* Uncomment border to see the touch target. */ padding-left: 59%; /* Enlarge the touch area. ((48-22)/2)px / 22px ~= 59% */ padding-right: 59%; /* Enlarge the touch area. */ left: -59%; }