Changeset 129867 in webkit
- Timestamp:
- Sep 28, 2012 2:40:39 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r129865 r129867 1 2012-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 Kent Tamura. 7 8 This patch adds Chromium port specific expectations for "month" input 9 type tests for multiple fields month input UI. 10 11 Note: This patch affects ports which enable both ENABLE_INPUT_TYPE_MONTH 12 and ENABLE_INPUT_MULTIPLE_FIELDS_UI. 13 14 * platform/chromium/fast/forms/month/month-input-visible-string-expected.txt: Added. Multiple fields month input UI doesn't have selection. 15 * platform/chromium/fast/forms/month/month-stepup-stepdown-from-renderer-expected.txt: Added. On multiple fields month input UI, step down/up decrement/increment a field rather than whole value. 16 1 17 2012-09-28 Vsevolod Vlasov <vsevik@chromium.org> 2 18 -
trunk/Source/WebCore/ChangeLog
r129863 r129867 1 2012-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 Kent Tamura. 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 Note: Actual outputs of two tests 18 - fast/forms/month/month-input-visible-string.html 19 - fast/forms/month/month-stepup-stepdown-from-renderer.html 20 are different. 21 22 * css/html.css: 23 (input::-webkit-datetime-edit-month-field): Added for field appearance. 24 (input::-webkit-datetime-edit-year-field): ditto. 25 (input::-webkit-datetime-edit-month-field:focus): Added to remove focus ring. 26 (input::-webkit-datetime-edit-year-field:focus): ditto. 27 * html/MonthInputType.cpp: 28 (WebCore::MonthInputType::formatDateTimeFieldsState): Added to format numeric value to string value as specified in HTML5 specification. 29 (WebCore::MonthInputType::setupLayoutParameters): Added to set layout of multiple fields. 30 * html/MonthInputType.h: Changed to include BaseMultipleFieldsDateAndTimeInputType.h and introduce BaseMonthInputType typedef. 31 (WebCore::MonthInputType::MonthInputType): Changed base class name to BaseMonthInputType. 32 (MonthInputType): Changed to add declarations for formatDateTimeFieldsState() and setupLayoutParameters(). 33 * html/shadow/DateTimeEditElement.cpp: 34 (DateTimeEditBuilder): Changed to have copy of object in m_stepRange and m_dateValue member variables for being robust. 35 (WebCore::DateTimeEditBuilder::DateTimeEditBuilder): Changed to add initialize m_placeholderForMonth and m_placeholderForYear. 36 (WebCore::DateTimeEditBuilder::visitField): Changed to support month field and year field. 37 * html/shadow/DateTimeEditElement.h: 38 (LayoutParameters): Changed to add member variables, placeholderForMonth and placeholderForYear. Changed to have copy of object in stepRange member variable for being robust. 39 1 40 2012-09-28 Eunmi Lee <eunmi15.lee@samsung.com> 2 41 -
trunk/Source/WebCore/css/html.css
r129612 r129867 478 478 479 479 #if defined(ENABLE_INPUT_MULTIPLE_FIELDS_UI) && ENABLE_INPUT_MULTIPLE_FIELDS_UI 480 input[type="month"], 480 481 input[type="time"] { 481 482 font-family: monospace; … … 520 521 } 521 522 523 input::-webkit-datetime-edit-month-field { 524 -webkit-user-modify: read-only !important; 525 display: inline-block; 526 border: none; 527 text-align: center; 528 padding: 0.15em; 529 } 530 522 531 /* This selector is used when step >= 3600 second but format contains minute field. */ 523 532 input::-webkit-datetime-edit-minute-field[readonly] { … … 526 535 527 536 input::-webkit-datetime-edit-second-field { 537 -webkit-user-modify: read-only !important; 538 display: inline-block; 539 border: none; 540 text-align: center; 541 padding: 0.15em; 542 } 543 544 input::-webkit-datetime-edit-year-field { 528 545 -webkit-user-modify: read-only !important; 529 546 display: inline-block; … … 538 555 input::-webkit-datetime-edit-millisecond-field:focus, 539 556 input::-webkit-datetime-edit-minute-field:focus, 540 input::-webkit-datetime-edit-second-field:focus { 557 input::-webkit-datetime-edit-month-field:focus, 558 input::-webkit-datetime-edit-second-field:focus, 559 input::-webkit-datetime-edit-year-field:focus { 541 560 background-color: highlight; 542 561 color: highlighttext; … … 549 568 } 550 569 570 input[type="month"]::-webkit-inner-spin-button, 551 571 input[type="time"]::-webkit-inner-spin-button { 552 572 margin-left: 0.2em; -
trunk/Source/WebCore/html/MonthInputType.cpp
r128149 r129867 42 42 43 43 #if ENABLE(INPUT_TYPE_MONTH) 44 45 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 46 #include "DateTimeFieldsState.h" 47 #include "LocalizedStrings.h" 48 #include "Localizer.h" 49 #include <wtf/text/WTFString.h> 50 #endif 44 51 45 52 namespace WebCore { … … 138 145 } 139 146 147 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 148 String MonthInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const 149 { 150 if (!dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear()) 151 return emptyString(); 152 return String::format("%04u-%02u", dateTimeFieldsState.year(), dateTimeFieldsState.month()); 153 } 154 155 void MonthInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const 156 { 157 layoutParameters.dateTimeFormat = monthFormatInLDML(); 158 layoutParameters.fallbackDateTimeFormat = "MM/yyyy"; 159 layoutParameters.placeholderForMonth = "--"; 160 layoutParameters.placeholderForYear = "----"; 161 } 162 #endif 140 163 } // namespace WebCore 141 164 -
trunk/Source/WebCore/html/MonthInputType.h
r120313 r129867 32 32 #define MonthInputType_h 33 33 34 #if ENABLE(INPUT_TYPE_MONTH) 35 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 36 #include "BaseMultipleFieldsDateAndTimeInputType.h" 37 #else 34 38 #include "BaseDateAndTimeInputType.h" 35 36 #if ENABLE(INPUT_TYPE_MONTH) 39 #endif 37 40 38 41 namespace WebCore { 39 42 40 class MonthInputType : public BaseDateAndTimeInputType { 43 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 44 typedef BaseMultipleFieldsDateAndTimeInputType BaseMonthInputType; 45 #else 46 typedef BaseDateAndTimeInputType BaseMonthInputType; 47 #endif 48 49 class MonthInputType : public BaseMonthInputType { 41 50 public: 42 51 static PassOwnPtr<InputType> create(HTMLInputElement*); 43 52 44 53 private: 45 MonthInputType(HTMLInputElement* element) : Base DateAndTimeInputType(element) { }54 MonthInputType(HTMLInputElement* element) : BaseMonthInputType(element) { } 46 55 virtual const AtomicString& formControlType() const OVERRIDE; 47 56 virtual DateComponents::Type dateType() const OVERRIDE; … … 54 63 virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE; 55 64 virtual bool isMonthField() const OVERRIDE; 65 66 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 67 // BaseMultipleFieldsDateAndTimeInputType functions 68 virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL; 69 virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE FINAL; 70 #endif 56 71 }; 57 72 -
trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp
r129832 r129867 65 65 66 66 DateTimeEditElement& m_editElement; 67 const DateComponents &m_dateValue;68 const StepRange &m_stepRange;67 const DateComponents m_dateValue; 68 const StepRange m_stepRange; 69 69 Localizer& m_localizer; 70 const String m_placeholderForMonth; 71 const String m_placeholderForYear; 70 72 }; 71 73 … … 75 77 , m_stepRange(layoutParameters.stepRange) 76 78 , m_localizer(layoutParameters.localizer) 79 , m_placeholderForMonth(layoutParameters.placeholderForMonth) 80 , m_placeholderForYear(layoutParameters.placeholderForYear) 77 81 { 78 82 } … … 120 124 } 121 125 126 case DateTimeFormat::FieldTypeMonth: 127 // We always use "MM", two digits month, even if "M", "MMM", "MMMM", or "MMMMM". 128 m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_placeholderForMonth)); 129 return; 130 122 131 case DateTimeFormat::FieldTypePeriod: 123 132 m_editElement.addField(DateTimeAMPMFieldElement::create(document, m_editElement, m_localizer.timeAMPMLabels())); … … 144 153 return; 145 154 } 155 156 case DateTimeFormat::FieldTypeYear: 157 m_editElement.addField(DateTimeYearFieldElement::create(document, m_editElement, m_placeholderForYear)); 158 return; 146 159 147 160 default: -
trunk/Source/WebCore/html/shadow/DateTimeEditElement.h
r129832 r129867 66 66 String fallbackDateTimeFormat; 67 67 Localizer& localizer; 68 const StepRange& stepRange; 68 const StepRange stepRange; 69 String placeholderForMonth; 70 String placeholderForYear; 69 71 70 72 LayoutParameters(Localizer& localizer, const StepRange& stepRange)
Note: See TracChangeset
for help on using the changeset viewer.