Changeset 139865 in webkit
- Timestamp:
- Jan 16, 2013 3:04:36 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139863 r139865 1 2013-01-16 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: Unable to edit a time field with step=86400, and confusing appearance 4 https://bugs.webkit.org/show_bug.cgi?id=106983 5 6 Reviewed by Kentaro Hara. 7 8 Note: We don't add tests for input[type=datetime] now because the WHATWG 9 specification might be changed. 10 11 * fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-readonly-subfield-expected.txt: Added. 12 * fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-readonly-subfield.html: Added. 13 14 * fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield-expected.txt: 15 * fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield.html: 16 Update test cases for new behavior. We should not make hour fields 17 read-only for input[type=time]. 18 * platform/chromium-mac/fast/forms/time/time-appearance-basic-expected.png: Ditto. 19 * platform/chromium/TestExpectations: Add time-appearance-basic.html. 20 1 21 2013-01-16 Nandor Huszka <hnandor@inf.u-szeged.hu> 2 22 -
trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield-expected.txt
r134390 r139865 23 23 PASS isReadOnlyField(createTimeInput("00:00", step1hour, "00:35"), pseudoMinute) is false 24 24 Hour field: 25 PASS isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoHour) is true26 PASS isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoAMPM) is true25 PASS isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoHour) is false 26 PASS isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoAMPM) is false 27 27 PASS isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoMinute) is true 28 PASS isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoHour) is true29 PASS isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoAMPM) is true28 PASS isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoHour) is false 29 PASS isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoAMPM) is false 30 30 PASS isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoMinute) is true 31 31 PASS isReadOnlyField(createTimeInput("11:30", step1day, "12:30"), pseudoHour) is false -
trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-readonly-subfield.html
r134390 r139865 54 54 55 55 debug('Hour field:'); 56 shouldBe True('isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoHour)');57 shouldBe True('isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoAMPM)');56 shouldBeFalse('isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoHour)'); 57 shouldBeFalse('isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoAMPM)'); 58 58 shouldBeTrue('isReadOnlyField(createTimeInput("11:00", step1day, ""), pseudoMinute)'); 59 shouldBe True('isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoHour)');60 shouldBe True('isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoAMPM)');59 shouldBeFalse('isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoHour)'); 60 shouldBeFalse('isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoAMPM)'); 61 61 shouldBeTrue('isReadOnlyField(createTimeInput("11:30", step1day, "11:30"), pseudoMinute)'); 62 62 shouldBeFalse('isReadOnlyField(createTimeInput("11:30", step1day, "12:30"), pseudoHour)'); -
trunk/LayoutTests/platform/chromium/TestExpectations
r139846 r139865 4092 4092 webkit.org/b/104993 [ XP ] fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer.html [ Failure ] 4093 4093 4094 # Need rebaseline 4095 webkit.org/b/106983 fast/forms/time/time-appearance-basic.html [ Failure ] 4096 4094 4097 webkit.org/b/106518 compositing/iframes/iframe-content-flipping.html [ ImageOnlyFailure ] 4095 4098 webkit.org/b/106518 platform/chromium/virtual/softwarecompositing/iframes/iframe-content-flipping.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r139864 r139865 1 2013-01-16 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: Unable to edit a time field with step=86400, and confusing appearance 4 https://bugs.webkit.org/show_bug.cgi?id=106983 5 6 Reviewed by Kentaro Hara. 7 8 For example, we show a read-only hour field and a read-only minutes 9 field for <input type=time min="17:00" step=86400> because the step 10 value is 24 hours and the hour field can be only 17. However, we need to 11 provide a way to clear the value of the time field in such case. We 12 shouldn't make the hour field read-only if no other fields are editable. 13 14 - We don't make hour fields read-only for input[type=time]. 15 16 - We make hour fields read-only for input[type=datetime-local] only if 17 year, month, or day field is editable. e.g. 18 <input type=datetime-local min=2013-01-16T17:00 step=86400>: 19 The hour field is read-only, and year/month/day fields are editable. 20 <input type=datetime-local min=2013-01-16T17:00 max=2013-01-16T18:00 step=86400>: 21 The hour field is editable, and year/month/day fields are read-only. 22 23 Test: fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-readonly-subfield.html 24 25 * html/shadow/DateTimeEditElement.cpp: 26 (DateTimeEditBuilder): Declare new functions. 27 (WebCore::DateTimeEditBuilder::getRangeOfDayOfMonthField): 28 Added a function by extracting some code from visitField. 29 (WebCore::DateTimeEditBuilder::visitField): 30 (WebCore::DateTimeEditBuilder::shouldDayOfMonthFieldReadOnly): 31 Added a function by extracting some code from visitField. 32 (WebCore::DateTimeEditBuilder::shouldHourFieldReadOnly): 33 If the type is "time", we don't make hour fields read-only. 34 Otherwise, we don't make hour fields read-only if year/month/day fields 35 are read-only. Note that we don't need to check read-only status of year 36 and month fields explicitly here because a day field can be read-only 37 only if the year field and the month field are read-only. 38 1 39 2013-01-16 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 40 -
trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp
r139174 r139865 60 60 61 61 private: 62 void getRangeOfDayOfMonthField(int& minDay, int& maxDay) const; 62 63 bool needMillisecondField() const; 64 bool shouldDayOfMonthFieldReadOnly(int minDay, int maxDay) const; 63 65 bool shouldHourFieldReadOnly() const; 64 66 bool shouldMillisecondFieldReadOnly() const; … … 91 93 } 92 94 95 void DateTimeEditBuilder::getRangeOfDayOfMonthField(int& minDay, int& maxDay) const 96 { 97 minDay = 1; 98 maxDay = 31; 99 if (m_parameters.minimum.type() != DateComponents::Invalid 100 && m_parameters.maximum.type() != DateComponents::Invalid 101 && m_parameters.minimum.fullYear() == m_parameters.maximum.fullYear() 102 && m_parameters.minimum.month() == m_parameters.maximum.month() 103 && m_parameters.minimum.monthDay() <= m_parameters.maximum.monthDay()) { 104 minDay = m_parameters.minimum.monthDay(); 105 maxDay = m_parameters.maximum.monthDay(); 106 } 107 } 108 93 109 bool DateTimeEditBuilder::needMillisecondField() const 94 110 { … … 107 123 switch (fieldType) { 108 124 case DateTimeFormat::FieldTypeDayOfMonth: { 109 int minDay = 1, maxDay = 31; 110 if (m_parameters.minimum.type() != DateComponents::Invalid 111 && m_parameters.maximum.type() != DateComponents::Invalid 112 && m_parameters.minimum.fullYear() == m_parameters.maximum.fullYear() 113 && m_parameters.minimum.month() == m_parameters.maximum.month() 114 && m_parameters.minimum.monthDay() <= m_parameters.maximum.monthDay()) { 115 minDay = m_parameters.minimum.monthDay(); 116 maxDay = m_parameters.maximum.monthDay(); 117 } 125 int minDay, maxDay; 126 getRangeOfDayOfMonthField(minDay, maxDay); 118 127 RefPtr<DateTimeFieldElement> field = DateTimeDayFieldElement::create(document, m_editElement, m_parameters.placeholderForDay, minDay, maxDay); 119 128 m_editElement.addField(field); 120 if ( minDay == maxDay && minDay == m_dateValue.monthDay() && m_dateValue.type() != DateComponents::Date) {129 if (shouldDayOfMonthFieldReadOnly(minDay, maxDay)) { 121 130 field->setValueAsDate(m_dateValue); 122 131 field->setReadOnly(); … … 297 306 } 298 307 308 bool DateTimeEditBuilder::shouldDayOfMonthFieldReadOnly(int minDay, int maxDay) const 309 { 310 return minDay == maxDay && minDay == m_dateValue.monthDay() && m_dateValue.type() != DateComponents::Date; 311 } 312 299 313 bool DateTimeEditBuilder::shouldHourFieldReadOnly() const 300 314 { 315 if (m_dateValue.type() == DateComponents::Time) 316 return false; 317 ASSERT(m_dateValue.type() == DateComponents::DateTimeLocal || m_dateValue.type() == DateComponents::DateTime); 318 int minDay, maxDay; 319 getRangeOfDayOfMonthField(minDay, maxDay); 320 if (shouldDayOfMonthFieldReadOnly(minDay, maxDay)) { 321 ASSERT(m_parameters.minimum.fullYear() == m_parameters.maximum.fullYear()); 322 ASSERT(m_parameters.minimum.month() == m_parameters.maximum.month()); 323 return false; 324 } 325 301 326 const Decimal decimalMsPerDay(static_cast<int>(msPerDay)); 302 327 Decimal hourPartOfMinimum = (stepRange().minimum().abs().remainder(decimalMsPerDay) / static_cast<int>(msPerHour)).floor();
Note: See TracChangeset
for help on using the changeset viewer.