Changeset 130024 in webkit
- Timestamp:
- Oct 1, 2012 3:23:21 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r130023 r130024 1 2012-10-01 Yoshifumi Inoue <yosin@chromium.org> 2 3 [Forms] Multiple fields week input UI 4 https://bugs.webkit.org/show_bug.cgi?id=97877 5 6 Reviewed by Kent Tamura. 7 8 This patch adds Chromium port specific expectations for "week" input 9 type tests for multiple fields week input UI. 10 11 Note: This patch affects ports which enable both ENABLE_INPUT_TYPE_WEEK 12 and ENABLE_INPUT_MULTIPLE_FIELDS_UI. 13 14 * platform/chromium/fast/forms/week/week-input-visible-string-expected.txt: Added. Multiple fields week input UI doesn't have selection. 15 * platform/chromium/fast/forms/week/week-stepup-stepdown-from-renderer-expected.txt: Added. On multiple fields week input UI, step down/up decrement/increment a field rather than whole value. 16 1 17 2012-10-01 Andrey Kosyakov <caseq@chromium.org> 2 18 -
trunk/Source/WebCore/ChangeLog
r130021 r130024 1 2012-10-01 Yoshifumi Inoue <yosin@chromium.org> 2 3 [Forms] Multiple fields week input UI 4 https://bugs.webkit.org/show_bug.cgi?id=97877 5 6 Reviewed by Kent Tamura. 7 8 This patch introduces multiple fields "week" 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_WEEK 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 week input UI. 16 17 Note: Actual outputs of two tests 18 - fast/forms/week/week-input-visible-string.html 19 - fast/forms/week/week-stepup-stepdown-from-renderer.html 20 are different. 21 22 * css/thml.css: 23 (input::-webkit-datetime-edit-week-field): Added for field appearance. 24 (input::-webkit-datetime-edit-week-field:focus): Added to remove focus ring. 25 * html/WeekInputType.cpp: 26 (WebCore::WeekInputType::formatDateTimeFieldsState): Added to format numeric value to string value as specified in HTML5 specification. 27 (WebCore::WeekInputType::setupLayoutParameters): Added to set layout of multiple fields. 28 * html/WeekInputType.h: Changed to include BaseMultipleFieldsDateAndTimeInputType.h and introduce BaseWeekInputType typedef. 29 (WebCore::WeekInputType::WeekInputType): Changed base class name to BaseWeekInputType. 30 (WeekInputType): Changed to add declarations for formatDateTimeFieldsState() and setupLayoutParameters(). 31 * html/shadow/DateTimeEditElement.cpp: 32 (WebCore::DateTimeEditBuilder::visitField): Changed to support week field. 33 1 34 2012-10-01 Pavel Feldman <pfeldman@chromium.org> 2 35 -
trunk/Source/WebCore/css/html.css
r129867 r130024 479 479 #if defined(ENABLE_INPUT_MULTIPLE_FIELDS_UI) && ENABLE_INPUT_MULTIPLE_FIELDS_UI 480 480 input[type="month"], 481 input[type="time"] { 481 input[type="time"], 482 input[type="week"] { 482 483 font-family: monospace; 483 484 } … … 535 536 536 537 input::-webkit-datetime-edit-second-field { 538 -webkit-user-modify: read-only !important; 539 display: inline-block; 540 border: none; 541 text-align: center; 542 padding: 0.15em; 543 } 544 545 input::-webkit-datetime-edit-week-field { 537 546 -webkit-user-modify: read-only !important; 538 547 display: inline-block; … … 557 566 input::-webkit-datetime-edit-month-field:focus, 558 567 input::-webkit-datetime-edit-second-field:focus, 568 input::-webkit-datetime-edit-week-field:focus, 559 569 input::-webkit-datetime-edit-year-field:focus { 560 570 background-color: highlight; -
trunk/Source/WebCore/html/WeekInputType.cpp
r128149 r130024 39 39 40 40 #if ENABLE(INPUT_TYPE_WEEK) 41 42 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 43 #include "DateTimeFieldsState.h" 44 #include "LocalizedStrings.h" 45 #include <wtf/text/WTFString.h> 46 #endif 41 47 42 48 namespace WebCore { … … 92 98 } 93 99 100 101 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 102 String WeekInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const 103 { 104 if (!dateTimeFieldsState.hasYear() || !dateTimeFieldsState.hasWeekOfYear()) 105 return emptyString(); 106 return String::format("%04u-W%02u", dateTimeFieldsState.year(), dateTimeFieldsState.weekOfYear()); 107 } 108 109 void WeekInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents&) const 110 { 111 layoutParameters.dateTimeFormat = weekFormatInLDML(); 112 layoutParameters.fallbackDateTimeFormat = "'Week' WW-yyyy"; 113 layoutParameters.placeholderForYear = "----"; 114 } 115 #endif 116 94 117 } // namespace WebCore 95 118 -
trunk/Source/WebCore/html/WeekInputType.h
r117738 r130024 32 32 #define WeekInputType_h 33 33 34 #include "Base DateAndTimeInputType.h"34 #include "BaseMultipleFieldsDateAndTimeInputType.h" 35 35 36 36 #if ENABLE(INPUT_TYPE_WEEK) … … 38 38 namespace WebCore { 39 39 40 class WeekInputType : public BaseDateAndTimeInputType { 40 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 41 typedef BaseMultipleFieldsDateAndTimeInputType BaseWeekInputType; 42 #else 43 typedef BaseDateAndTimeInputType BaseWeekInputType; 44 #endif 45 46 class WeekInputType : public BaseWeekInputType { 41 47 public: 42 48 static PassOwnPtr<InputType> create(HTMLInputElement*); 43 49 44 50 private: 45 WeekInputType(HTMLInputElement* element) : Base DateAndTimeInputType(element) { }51 WeekInputType(HTMLInputElement* element) : BaseWeekInputType(element) { } 46 52 virtual const AtomicString& formControlType() const OVERRIDE; 47 53 virtual DateComponents::Type dateType() const OVERRIDE; … … 50 56 virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE; 51 57 virtual bool isWeekField() const OVERRIDE; 58 59 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 60 // BaseMultipleFieldsDateAndTimeInputType functions 61 virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL; 62 virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE FINAL; 63 #endif 52 64 }; 53 65 -
trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp
r129867 r130024 154 154 } 155 155 156 case DateTimeFormat::FieldTypeWeekOfYear: 157 m_editElement.addField(DateTimeWeekFieldElement::create(document, m_editElement)); 158 return; 159 156 160 case DateTimeFormat::FieldTypeYear: 157 161 m_editElement.addField(DateTimeYearFieldElement::create(document, m_editElement, m_placeholderForYear));
Note: See TracChangeset
for help on using the changeset viewer.