[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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@272495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b2fdfb12..2d617b5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,31 @@
+2021-02-08  Aditya Keerthi  <akeerthi@apple.com>
+
+        [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.
+
+        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:
+
 2021-02-08  Antti Koivisto  <antti@apple.com>
 
         [LFC][Integration] Hit test inline boxes
diff --git a/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events-expected.txt b/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events-expected.txt
index 3a133ce..bf1eb91 100644
--- a/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events-expected.txt
+++ b/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events-expected.txt
@@ -36,15 +36,14 @@
 PASS inputEventsFired is 3
 
 Advance field keys
-PASS input.value is "2020-06-02"
 PASS input.value is "2020-06-03"
 PASS input.value is "2020-06-04"
 PASS input.value is "2020-06-05"
 PASS input.value is "2020-06-06"
 PASS input.value is "2020-06-07"
 PASS input.value is "2020-06-08"
-PASS changeEventsFired is 7
-PASS inputEventsFired is 7
+PASS changeEventsFired is 6
+PASS inputEventsFired is 6
 
 Up/Down arrow keys
 PASS input.value is "2020-01-20"
diff --git a/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events.html b/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events.html
index efbb7d2..f35d48c 100644
--- a/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events.html
+++ b/LayoutTests/fast/forms/date/date-editable-components/date-editable-components-keyboard-events.html
@@ -130,12 +130,8 @@
     shouldBe("changeEventsFired", "3");
     shouldBe("inputEventsFired", "3");
 
-    beginTest("Advance field keys", "2020-06-05");         // [06]/01/2020
-    UIHelper.keyDown(" ");                                 // -> 06/[01]/2020
-    UIHelper.keyDown("2");                                 // -> 06/[02]/2020
-    shouldBeEqualToString("input.value", "2020-06-02");
-    UIHelper.keyDown("leftArrow");                         // -> [06]/02/2020
-    UIHelper.keyDown("/");                                 // -> 06/[02]/2020
+    beginTest("Advance field keys", "2020-06-05");         // [06]/05/2020
+    UIHelper.keyDown("/");                                 // -> 06/[05]/2020
     UIHelper.keyDown("3");                                 // -> 06/[03]/2020
     shouldBeEqualToString("input.value", "2020-06-03");
     UIHelper.keyDown("leftArrow");                         // -> [06]/03/2020
@@ -158,8 +154,8 @@
     UIHelper.keyDown(",");                                 // -> 06/[07]/2020
     UIHelper.keyDown("8");                                 // -> 06/[08]/2020
     shouldBeEqualToString("input.value", "2020-06-08");
-    shouldBe("changeEventsFired", "7");
-    shouldBe("inputEventsFired", "7");
+    shouldBe("changeEventsFired", "6");
+    shouldBe("inputEventsFired", "6");
 
     beginTest("Up/Down arrow keys", "2020-12-20");         // [12]/20/2020
     UIHelper.keyDown("upArrow");                           // [01]/20/2020
diff --git a/LayoutTests/fast/forms/date/date-editable-components/date-picker-show-on-space-keypress-expected.txt b/LayoutTests/fast/forms/date/date-editable-components/date-picker-show-on-space-keypress-expected.txt
new file mode 100644
index 0000000..0d98696
--- /dev/null
+++ b/LayoutTests/fast/forms/date/date-editable-components/date-picker-show-on-space-keypress-expected.txt
@@ -0,0 +1,12 @@
+Tests that a date input's calendar view can be opened using the space key, without any mouse interaction.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS showingPicker is false
+Focusing input using tab key and then pressing space key.
+PASS showingPicker is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html b/LayoutTests/fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html
new file mode 100644
index 0000000..0ad59ac
--- /dev/null
+++ b/LayoutTests/fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../../resources/js-test.js"></script>
+<script src="../../../../resources/ui-helper.js"></script>
+</head>
+<body>
+
+<input id="input" type="date" value="2020-09-16"/>
+
+<script>
+
+jsTestIsAsync = true;
+
+addEventListener("load", async () => {
+    description("Tests that a date input's calendar view can be opened using the space key, without any mouse interaction.");
+
+    showingPicker = await UIHelper.isShowingDateTimePicker();
+    shouldBeFalse("showingPicker");
+
+    debug("Focusing input using tab key and then pressing space key.");
+    UIHelper.keyDown("\t");
+    UIHelper.keyDown(" ");
+    await UIHelper.ensurePresentationUpdate();
+
+    showingPicker = await UIHelper.isShowingDateTimePicker();
+    shouldBeTrue("showingPicker");
+
+    finishJSTest();
+});
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/date/date-editable-components/form-submit-on-return-keypress-expected.txt b/LayoutTests/fast/forms/date/date-editable-components/form-submit-on-return-keypress-expected.txt
new file mode 100644
index 0000000..a7dc22c
--- /dev/null
+++ b/LayoutTests/fast/forms/date/date-editable-components/form-submit-on-return-keypress-expected.txt
@@ -0,0 +1,10 @@
+Tests that focusing a date input and pressing the return key submits a form.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Submitted form.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Enter birthday:
diff --git a/LayoutTests/fast/forms/date/date-editable-components/form-submit-on-return-keypress.html b/LayoutTests/fast/forms/date/date-editable-components/form-submit-on-return-keypress.html
new file mode 100644
index 0000000..0bb6889
--- /dev/null
+++ b/LayoutTests/fast/forms/date/date-editable-components/form-submit-on-return-keypress.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../../resources/js-test.js"></script>
+<script src="../../../../resources/ui-helper.js"></script>
+</head>
+<body>
+
+<form id="form">
+    Enter birthday: <input id="input" type="date" value="2020-09-16"/>
+    <input type="submit"/>
+</form>
+
+<script>
+
+jsTestIsAsync = true;
+
+addEventListener("load", async () => {
+    description("Tests that focusing a date input and pressing the return key submits a form.");
+
+    form.addEventListener("submit", (event) => {
+        debug("Submitted form.");
+        finishJSTest();
+    });
+
+    UIHelper.keyDown("\t");
+    UIHelper.keyDown("\r");
+});
+
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events-expected.txt b/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events-expected.txt
index 51c04f9..2b5d74c 100644
--- a/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events-expected.txt
+++ b/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events-expected.txt
@@ -38,15 +38,14 @@
 PASS inputEventsFired is 11
 
 Advance field keys
-PASS input.value is "2020-06-02T16:27"
 PASS input.value is "2020-06-03T16:27"
 PASS input.value is "2020-06-04T16:27"
 PASS input.value is "2020-06-05T16:27"
 PASS input.value is "2020-06-06T16:27"
 PASS input.value is "2020-06-07T16:27"
 PASS input.value is "2020-06-08T16:27"
-PASS changeEventsFired is 7
-PASS inputEventsFired is 7
+PASS changeEventsFired is 6
+PASS inputEventsFired is 6
 
 Up/Down arrow keys
 PASS input.value is "2020-01-20T23:59"
diff --git a/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events.html b/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events.html
index 4ba0a4b..62194d5 100644
--- a/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events.html
+++ b/LayoutTests/fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events.html
@@ -141,12 +141,8 @@
     shouldBe("changeEventsFired", "11");
     shouldBe("inputEventsFired", "11");
 
-    beginTest("Advance field keys", "2020-06-05T16:27");        // [06]/01/2020 04:27 PM
-    UIHelper.keyDown(" ");                                      // -> 06/[01]/2020 04:27 PM
-    UIHelper.keyDown("2");                                      // -> 06/[02]/2020 04:27 PM
-    shouldBeEqualToString("input.value", "2020-06-02T16:27");
-    UIHelper.keyDown("leftArrow");                              // -> [06]/02/2020 04:27 PM
-    UIHelper.keyDown("/");                                      // -> 06/[02]/2020 04:27 PM
+    beginTest("Advance field keys", "2020-06-05T16:27");        // [06]/05/2020 04:27 PM
+    UIHelper.keyDown("/");                                      // -> 06/[05]/2020 04:27 PM
     UIHelper.keyDown("3");                                      // -> 06/[03]/2020 04:27 PM
     shouldBeEqualToString("input.value", "2020-06-03T16:27");
     UIHelper.keyDown("leftArrow");                              // -> [06]/03/2020 04:27 PM
@@ -169,8 +165,8 @@
     UIHelper.keyDown(",");                                      // -> 06/[07]/2020 04:27 PM
     UIHelper.keyDown("8");                                      // -> 06/[08]/2020 04:27 PM
     shouldBeEqualToString("input.value", "2020-06-08T16:27");
-    shouldBe("changeEventsFired", "7");
-    shouldBe("inputEventsFired", "7");
+    shouldBe("changeEventsFired", "6");
+    shouldBe("inputEventsFired", "6");
 
     beginTest("Up/Down arrow keys", "2020-12-20T23:59");        // [12]/20/2020 11:59 PM
     UIHelper.keyDown("upArrow");                                // -> [01]/20/2020 11:59 PM
diff --git a/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events-expected.txt b/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events-expected.txt
index 4565f90..e9ddf16 100644
--- a/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events-expected.txt
+++ b/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events-expected.txt
@@ -36,15 +36,14 @@
 PASS inputEventsFired is 2
 
 Advance field keys
-PASS input.value is "0002-06"
 PASS input.value is "0003-06"
 PASS input.value is "0004-06"
 PASS input.value is "0005-06"
 PASS input.value is "0006-06"
 PASS input.value is "0007-06"
 PASS input.value is "0008-06"
-PASS changeEventsFired is 7
-PASS inputEventsFired is 7
+PASS changeEventsFired is 6
+PASS inputEventsFired is 6
 
 Up/Down arrow keys
 PASS input.value is "2020-01"
diff --git a/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events.html b/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events.html
index f6781e1..5a6e6e8 100644
--- a/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events.html
+++ b/LayoutTests/fast/forms/month/month-editable-components/month-editable-components-keyboard-events.html
@@ -113,11 +113,7 @@
     shouldBe("inputEventsFired", "2");
 
     beginTest("Advance field keys", "2020-06");            // [06]/2020
-    UIHelper.keyDown(" ");                                 // -> 06/[2020]
-    UIHelper.keyDown("2");                                 // -> 06/[0002]
-    shouldBeEqualToString("input.value", "0002-06");
-    UIHelper.keyDown("leftArrow");                         // -> [06]/0002
-    UIHelper.keyDown("/");                                 // -> 06/[0002]
+    UIHelper.keyDown("/");                                 // -> 06/[2020]
     UIHelper.keyDown("3");                                 // -> 06/[0003]
     shouldBeEqualToString("input.value", "0003-06");
     UIHelper.keyDown("leftArrow");                         // -> [06]/0003
@@ -140,8 +136,8 @@
     UIHelper.keyDown(",");                                 // -> 06/[0007]
     UIHelper.keyDown("8");                                 // -> 06/[0008]
     shouldBeEqualToString("input.value", "0008-06");
-    shouldBe("changeEventsFired", "7");
-    shouldBe("inputEventsFired", "7");
+    shouldBe("changeEventsFired", "6");
+    shouldBe("inputEventsFired", "6");
 
     beginTest("Up/Down arrow keys", "2020-12");            // [12]/2020
     UIHelper.keyDown("upArrow");                           // [01]/2020
diff --git a/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events-expected.txt b/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events-expected.txt
index baa97e2..804ae52 100644
--- a/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events-expected.txt
+++ b/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events-expected.txt
@@ -30,15 +30,14 @@
 PASS inputEventsFired is 5
 
 Advance field keys
-PASS input.value is "01:02"
 PASS input.value is "01:03"
 PASS input.value is "01:04"
 PASS input.value is "01:05"
 PASS input.value is "01:06"
 PASS input.value is "01:07"
 PASS input.value is "01:08"
-PASS changeEventsFired is 7
-PASS inputEventsFired is 7
+PASS changeEventsFired is 6
+PASS inputEventsFired is 6
 
 Up/Down arrow keys
 PASS input.value is "12:59"
diff --git a/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events.html b/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events.html
index 062cf48..50fb5f2 100644
--- a/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events.html
+++ b/LayoutTests/fast/forms/time/time-editable-components/time-editable-components-keyboard-events.html
@@ -94,11 +94,7 @@
     shouldBe("inputEventsFired", "5");
 
     beginTest("Advance field keys", "01:28");              // [01]:28 AM
-    UIHelper.keyDown(" ");                                 // -> 01:[28] AM
-    UIHelper.keyDown("2");                                 // -> 01:[02] AM
-    shouldBeEqualToString("input.value", "01:02");
-    UIHelper.keyDown("leftArrow");                         // -> [01]:02 AM
-    UIHelper.keyDown("/");                                 // -> 01:[02] AM
+    UIHelper.keyDown("/");                                 // -> 01:[28] AM
     UIHelper.keyDown("3");                                 // -> 01:[03] AM
     shouldBeEqualToString("input.value", "01:03");
     UIHelper.keyDown("leftArrow");                         // -> [01]:03 AM
@@ -121,8 +117,8 @@
     UIHelper.keyDown(",");                                 // -> 01:[07] AM
     UIHelper.keyDown("8");                                 // -> 01:[08] AM
     shouldBeEqualToString("input.value", "01:08");
-    shouldBe("changeEventsFired", "7");
-    shouldBe("inputEventsFired", "7");
+    shouldBe("changeEventsFired", "6");
+    shouldBe("inputEventsFired", "6");
 
     beginTest("Up/Down arrow keys", "23:59");              // [11]:59 PM
     UIHelper.keyDown("upArrow");                           // -> [12]:59 PM
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index dc679a4..604930d 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,46 @@
+2021-02-08  Aditya Keerthi  <akeerthi@apple.com>
+
+        [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.
+
+        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.
+
 2021-02-08  Antti Koivisto  <antti@apple.com>
 
         [LFC][Integration] Hit test inline boxes
diff --git a/Source/WebCore/html/BaseDateAndTimeInputType.cpp b/Source/WebCore/html/BaseDateAndTimeInputType.cpp
index fb38db6..8c0e1f5 100644
--- a/Source/WebCore/html/BaseDateAndTimeInputType.cpp
+++ b/Source/WebCore/html/BaseDateAndTimeInputType.cpp
@@ -413,6 +413,11 @@
 
 void BaseDateAndTimeInputType::handleKeypressEvent(KeyboardEvent& event)
 {
+    // The return key should not activate the element, as it conflicts with
+    // the key binding to submit a form.
+    if (event.charCode() == '\r')
+        return;
+
     ASSERT(element());
     BaseClickableWithKeyInputType::handleKeypressEvent(*element(), event);
 }
diff --git a/Source/WebCore/html/shadow/DateTimeFieldElement.cpp b/Source/WebCore/html/shadow/DateTimeFieldElement.cpp
index a8b191f..bebd52a 100644
--- a/Source/WebCore/html/shadow/DateTimeFieldElement.cpp
+++ b/Source/WebCore/html/shadow/DateTimeFieldElement.cpp
@@ -118,7 +118,7 @@
         return;
     }
 
-    if ((key == "Right" || code == "Comma" || code == "Minus" || code == "Period" || code == "Space" || code == "Slash" || code == "Semicolon")
+    if ((key == "Right" || code == "Comma" || code == "Minus" || code == "Period" || code == "Slash" || code == "Semicolon")
         && m_fieldOwner && m_fieldOwner->focusOnNextField(*this)) {
         keyboardEvent.setDefaultHandled();
         return;