12012-09-28 Yoshifumi Inoue <yosin@chromium.org>
2
3 [Forms] Multiple fields month input UI
4 https://bugs.webkit.org/show_bug.cgi?id=97299
5
6 Reviewed by NOBODY (OOPS!).
7
8 This patch introduces multiple fields "month" input UI in DRT. We'll
9 enable this feature once we add tests.
10
11 Note: This patch affects ports which enable both ENABLE_INPUT_TYPE_MONTH
12 and ENABLE_INPUT_MULTIPLE_FIELDS_UI.
13
14 No new tests. To reduce size of this patch, other patches add tests
15 for multiple fields month input UI.
16
17 * css/html.css:
18 (input::-webkit-datetime-edit-month-field): Added for field appearance.
19 (input::-webkit-datetime-edit-year-field): ditto.
20 (input::-webkit-datetime-edit-month-field:focus): Added to remove focus ring.
21 (input::-webkit-datetime-edit-year-field:focus): ditto.
22 * html/MonthInputType.cpp:
23 (WebCore::MonthInputType::formatDateTimeFieldsState): Added to format numeric value to string value as specified in HTML5 specification.
24 (WebCore::MonthInputType::setupLayoutParameters): Added to set layout of multiple fields.
25 * html/MonthInputType.h: Changed to include BaseMultipleFieldsDateAndTimeInputType.h and introduce BaseMonthInputType typedef.
26 (WebCore::MonthInputType::MonthInputType): Changed base class name to BaseMonthInputType.
27 (MonthInputType): Changed to add declarations for formatDateTimeFieldsState() and setupLayoutParameters().
28 * html/shadow/DateTimeEditElement.cpp:
29 (DateTimeEditBuilder): Changed to have copy of object in m_stepRange and m_dateValue member variables for being robust.
30 (WebCore::DateTimeEditBuilder::DateTimeEditBuilder): Changed to add initialize m_placeholderForMonth and m_placeholderForYear.
31 (WebCore::DateTimeEditBuilder::visitField): Changed to support month field and year field.
32 * html/shadow/DateTimeEditElement.h:
33 (LayoutParameters): Changed to add member variables, placeholderForMonth and placeholderForYear. Changed to have copy of object in stepRange member variable for being robust.
34