[Forms] DateTimeEditElement should return string value for ease of implementing other...
authoryosin@chromium.org <yosin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 01:48:49 +0000 (01:48 +0000)
committeryosin@chromium.org <yosin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 01:48:49 +0000 (01:48 +0000)
commit31fdf7168ec313cb95e9871c8852fe9c48029343
treefc4711a1111273efaa9b50784bac57630eaae486
parentded7d2e977a1903cf6ee08ee0f8d5c9ae83703d3
[Forms] DateTimeEditElement should return string value for ease of implementing other date/time input types.
https://bugs.webkit.org/show_bug.cgi?id=97303

Reviewed by Kent Tamura.

This patch introduces a function DateTimeEditElement::value() for
setting internal text value of TimeInputType with new function
EditControlOwner::formatDateTimeFieldsState() to utilize this protocl
in other date time input types.

We used DateTimeEditElement::valueAsDouble() and and BaseDateAndTimeInputType::serialize()
to make string value then setting internal text value of multiple
fields time input UI. Although, this steps doesn't work well for
other date/time input types.

This patch affects ports which enable both ENABLE_INPUT_TYPE_TIME and
ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS.

No new tests. This patch doesn't change behavior.

* html/DateTimeFieldsState.cpp:
(WebCore::DateTimeFieldsState::hour23): Added to convert 1 to 12 hour value to 0 to 23 hour.
* html/DateTimeFieldsState.h:
(DateTimeFieldsState): Added declaration of hour23().
* html/TimeInputType.cpp:
(WebCore::TimeInputType::DateTimeEditControlOwnerImpl::editControlValueChanged): Changed to use DateTimeEditElement::value() instead of DateTimeEditElement::valueAsDouble().
(WebCore::TimeInputType::DateTimeEditControlOwnerImpl::formatDateTimeFieldsState): Added to format time.
(WebCore::TimeInputType::restoreFormControlState): Changed to use DateTimeEditElement::value() instead of DateTimeEditElement::valueAsDouble().
* html/TimeInputType.h:
(DateTimeEditControlOwnerImpl): Added a declaration of formatDateTimeFieldsState().
* html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditElement::value): Added.
* html/shadow/DateTimeEditElement.h:
(EditControlOwner): Added a declaration of formatDateTimeFieldsState().
(DateTimeEditElement): Added a declaration of value().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/DateTimeFieldsState.cpp
Source/WebCore/html/DateTimeFieldsState.h
Source/WebCore/html/TimeInputType.cpp
Source/WebCore/html/TimeInputType.h
Source/WebCore/html/shadow/DateTimeEditElement.cpp
Source/WebCore/html/shadow/DateTimeEditElement.h