haikuwebkit/LayoutTests/fast/forms/month
Aditya Keerthi 7ff67e4f7f [macOS] Return key binding for date inputs conflicts with return to submit form
https://bugs.webkit.org/show_bug.cgi?id=221532
<rdar://problem/74039204>

Reviewed by Wenson Hsieh.

Source/WebCore:

Currently, pressing the return key within a focused date input presents
the calendar view, rather than submitting an associated form. This is a
usability issue for keyboard users, and is different from the behavior
in Chrome. This patch matches the behavior in Chrome, and makes it so
that a return keypress submits an associated form.

However, since the return key is now reserved for form submission, we
need a new key to present the calendar view for the date input. Chrome
and Firefox use the space key for this functionality, so this patch
matches that behavior.

Note that r267281 updated date inputs to focus the next editable component
when pressing the space key. This behavior is now removed in favor of
presenting the calendar. Other separator keys, and arrow keys, can still be
used to focus the next editable component.

Tests: fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html
       fast/forms/date/date-editable-components/form-submit-on-return-keypress.html

* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::handleKeypressEvent):

Date and time inputs are BaseClickableWithKeyInputTypes. This gives them
activation behavior on return and space keypresses, similar to button and
color inputs. However, since date/time inputs are closer to textfields,
than buttons, we elide activation behavior on a return keypress, allowing
the event to submit an associated form. Activation behavior on a space
keypress is supported by going through the existing code path.

* html/shadow/DateTimeFieldElement.cpp:
(WebCore::DateTimeFieldElement::defaultKeyboardEventHandler):

Remove "Space" from the list of separator keys that focus the next
editable component.

LayoutTests:

Added tests to verify that pressing the space key in a focused date
input presents a calendar view, and pressing the enter key in a focused
date input submits a form.

Rebaselined existing tests to account for the fact that the space key
no longer focuses the next editable component within a date input.

* fast/forms/date/date-editable-components/date-editable-components-keyboard-events-expected.txt:
* fast/forms/date/date-editable-components/date-editable-components-keyboard-events.html:
* fast/forms/date/date-editable-components/date-picker-show-on-space-keypress-expected.txt: Added.
* fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html: Added.
* fast/forms/date/date-editable-components/form-submit-on-return-keypress-expected.txt: Added.
* fast/forms/date/date-editable-components/form-submit-on-return-keypress.html: Added.
* fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events-expected.txt:
* fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events.html:
* fast/forms/month/month-editable-components/month-editable-components-keyboard-events-expected.txt:
* fast/forms/month/month-editable-components/month-editable-components-keyboard-events.html:
* fast/forms/time/time-editable-components/time-editable-components-keyboard-events-expected.txt:
* fast/forms/time/time-editable-components/time-editable-components-keyboard-events.html:


Canonical link: https://commits.webkit.org/233809@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-08 16:42:11 +00:00
..
month-editable-components [macOS] Return key binding for date inputs conflicts with return to submit form 2021-02-08 16:42:11 +00:00
ValidityState-rangeOverflow-month-expected.txt
ValidityState-rangeOverflow-month.html
ValidityState-rangeUnderflow-month-expected.txt
ValidityState-rangeUnderflow-month.html
ValidityState-stepMismatch-month-expected.txt
ValidityState-stepMismatch-month.html
ValidityState-typeMismatch-month-expected.txt
ValidityState-typeMismatch-month.html
input-valueasdate-expected.txt
input-valueasdate-month-expected.txt
input-valueasdate-month.html
input-valueasdate.html
input-valueasnumber-month-expected.txt
input-valueasnumber-month.html
month-appearance-basic-expected.txt
month-appearance-basic.html
month-appearance-l10n-expected.txt
month-appearance-l10n.html
month-appearance-pseudo-elements-expected.txt
month-appearance-pseudo-elements.html
month-from-frameless-document-expected.html
month-from-frameless-document.html
month-input-type-expected.txt
month-input-type.html
month-interactive-validation-required-expected.txt
month-interactive-validation-required.html
month-pseudo-classes-expected.txt
month-pseudo-classes.html
month-setrangetext-expected.txt
month-setrangetext.html
month-stepup-stepdown-expected.txt
month-stepup-stepdown.html