Title: [127234] trunk
Revision
127234
Author
yo...@chromium.org
Date
2012-08-30 23:31:42 -0700 (Thu, 30 Aug 2012)

Log Message

[Forms] Blur from field should reset typeahead buffer in multiple fields time input UI
https://bugs.webkit.org/show_bug.cgi?id=95525

Reviewed by Kent Tamura.

Source/WebCore:

This patch changes to reset typeahead timer used in DateTimeNumericFieldElement
on blur from field. It is intuitive that not merging keyboard inputs
with interleaving focus motion, e.g. sequence type "1", type Tab, type
Shift+Tab, type "2" should set field to "2" instead of "12".

This patch affects ports which enable both ENABLE_INPUT_TYPE_TIME and
ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS.

No new tests. This patch adds a test case into fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html

* html/shadow/DateTimeNumericFieldElement.cpp:
(WebCore::DateTimeNumericFieldElement::didBlur): Added to reset typeahead timer, m_lastDigitCharTime.
* html/shadow/DateTimeNumericFieldElement.h:
(DateTimeNumericFieldElement): Added a declaration of didBlur().

LayoutTests:

This patch adds a new test case for checking blur event resets typeahead
buffer in multiple fields time input UI.

This patch affects ports which enable both ENABLE_INPUT_TYPE_TIME and
ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS.

* fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt: Changed to include an expectation of new test case.
* fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html: Added a new test case of blur event resets typeahead buffer.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (127233 => 127234)


--- trunk/LayoutTests/ChangeLog	2012-08-31 05:54:05 UTC (rev 127233)
+++ trunk/LayoutTests/ChangeLog	2012-08-31 06:31:42 UTC (rev 127234)
@@ -1,3 +1,19 @@
+2012-08-30  Yoshifumi Inoue  <yo...@chromium.org>
+
+        [Forms] Blur from field should reset typeahead buffer in multiple fields time input UI
+        https://bugs.webkit.org/show_bug.cgi?id=95525
+
+        Reviewed by Kent Tamura.
+
+        This patch adds a new test case for checking blur event resets typeahead
+        buffer in multiple fields time input UI.
+
+        This patch affects ports which enable both ENABLE_INPUT_TYPE_TIME and
+        ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS.
+
+        * fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt: Changed to include an expectation of new test case.
+        * fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html: Added a new test case of blur event resets typeahead buffer.
+
 2012-08-30  MORITA Hajime  <morr...@google.com>
 
         Unreviewed, rolling out r126127.

Modified: trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt (127233 => 127234)


--- trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt	2012-08-31 05:54:05 UTC (rev 127233)
+++ trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt	2012-08-31 06:31:42 UTC (rev 127234)
@@ -34,6 +34,9 @@
 PASS input.value is ""
 == Delete key ==
 PASS input.value is ""
+== Typeahead ==
+PASS input.value is "12:01:56"
+PASS input.value is "12:02:56"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html (127233 => 127234)


--- trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html	2012-08-31 05:54:05 UTC (rev 127233)
+++ trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html	2012-08-31 06:31:42 UTC (rev 127234)
@@ -117,6 +117,15 @@
 beginTest('Delete key', '12:34');
 keyDown("delete");
 shouldBeEqualToString('input.value', '');
+
+beginTest('Typeahead', '12:34:56');
+keyDown('rightArrow');
+keyDown('1');
+shouldBeEqualToString('input.value', '12:01:56');
+keyDown('rightArrow');
+keyDown('leftArrow');
+keyDown('2');
+shouldBeEqualToString('input.value', '12:02:56');
 </script>
 <script src=""
 </body>

Modified: trunk/Source/WebCore/ChangeLog (127233 => 127234)


--- trunk/Source/WebCore/ChangeLog	2012-08-31 05:54:05 UTC (rev 127233)
+++ trunk/Source/WebCore/ChangeLog	2012-08-31 06:31:42 UTC (rev 127234)
@@ -1,3 +1,25 @@
+2012-08-30  Yoshifumi Inoue  <yo...@chromium.org>
+
+        [Forms] Blur from field should reset typeahead buffer in multiple fields time input UI
+        https://bugs.webkit.org/show_bug.cgi?id=95525
+
+        Reviewed by Kent Tamura.
+
+        This patch changes to reset typeahead timer used in DateTimeNumericFieldElement
+        on blur from field. It is intuitive that not merging keyboard inputs
+        with interleaving focus motion, e.g. sequence type "1", type Tab, type
+        Shift+Tab, type "2" should set field to "2" instead of "12".
+
+        This patch affects ports which enable both ENABLE_INPUT_TYPE_TIME and
+        ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS.
+
+        No new tests. This patch adds a test case into fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html
+
+        * html/shadow/DateTimeNumericFieldElement.cpp:
+        (WebCore::DateTimeNumericFieldElement::didBlur): Added to reset typeahead timer, m_lastDigitCharTime.
+        * html/shadow/DateTimeNumericFieldElement.h:
+        (DateTimeNumericFieldElement): Added a declaration of didBlur().
+
 2012-08-30 MORITA Hajime  <morr...@google.com>
 
         Unreviewed, followup build fix against r127228.

Modified: trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp (127233 => 127234)


--- trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp	2012-08-31 05:54:05 UTC (rev 127233)
+++ trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp	2012-08-31 06:31:42 UTC (rev 127234)
@@ -72,6 +72,12 @@
 {
 }
 
+void DateTimeNumericFieldElement::didBlur()
+{
+    m_lastDigitCharTime = 0;
+    DateTimeFieldElement::didBlur();
+}
+
 void DateTimeNumericFieldElement::handleKeyboardEvent(KeyboardEvent* keyboardEvent)
 {
     if (isReadOnly())

Modified: trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.h (127233 => 127234)


--- trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.h	2012-08-31 05:54:05 UTC (rev 127233)
+++ trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.h	2012-08-31 06:31:42 UTC (rev 127234)
@@ -63,6 +63,7 @@
 
 private:
     // DateTimeFieldElement functions.
+    virtual void didBlur() OVERRIDE FINAL;
     virtual void handleKeyboardEvent(KeyboardEvent*) OVERRIDE FINAL;
     virtual void setEmptyValue(const DateComponents& dateForReadOnlyField, EventBehavior) OVERRIDE FINAL;
     virtual void stepDown() OVERRIDE FINAL;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to