Changeset 53964 in webkit
- Timestamp:
- Jan 27, 2010 5:24:10 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r53959 r53964 1 2010-01-27 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Add valueAsNumber support for type=datetime-local. 6 https://bugs.webkit.org/show_bug.cgi?id=34200 7 8 The test data is equivalent to input-valueasnumber-datetime.html. 9 The expectation contains two FAIL lines because they check 10 unimplemented features. 11 12 * fast/forms/input-valueasnumber-datetimelocal-expected.txt: Added. 13 * fast/forms/input-valueasnumber-datetimelocal.html: Added. 14 * fast/forms/script-tests/input-valueasnumber-datetimelocal.js: Added. 15 1 16 2010-01-27 Brian Weinstein <bweinstein@apple.com> 2 17 -
trunk/WebCore/ChangeLog
r53961 r53964 1 2010-01-27 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Add valueAsNumber support for type=datetime-local. 6 https://bugs.webkit.org/show_bug.cgi?id=34200 7 8 Implement necessary methods of ISODateTime, and call them from 9 HTMLInputElement. 10 11 Test: fast/forms/input-valueasnumber-datetimelocal.html 12 13 * html/HTMLInputElement.cpp: 14 (WebCore::HTMLInputElement::valueAsNumber): 15 (WebCore::HTMLInputElement::setValueAsNumber): 16 * html/ISODateTime.cpp: 17 (WebCore::ISODateTime::setMillisecondsSinceEpochForDateTimeLocal): 18 Implemented. Just call setMillisecondsSinceEpochForDateTime(). 19 (WebCore::ISODateTime::millisecondsSinceEpochForTime): 20 Accept to be called for m_type=DateTimeLocal. 21 (WebCore::ISODateTime::toString): Add DateTimeLocal support. 22 * html/ISODateTime.h: Declare new methods. 23 1 24 2010-01-27 Steve Falkenburg <sfalken@apple.com> 2 25 -
trunk/WebCore/html/HTMLInputElement.cpp
r53893 r53964 1474 1474 case DATE: 1475 1475 case DATETIME: 1476 case DATETIMELOCAL: 1476 1477 case MONTH: 1477 1478 case TIME: … … 1493 1494 case CHECKBOX: 1494 1495 case COLOR: 1495 case DATETIMELOCAL: // FIXME: Unlike valueAsDate, valueAsNumber should support DATETIMELOCAL type.1496 1496 case EMAIL: 1497 1497 case FILE: … … 1527 1527 setValueAsDate(newValue, ec); 1528 1528 return; 1529 case DATETIMELOCAL: { 1530 ISODateTime dateTime; 1531 if (!dateTime.setMillisecondsSinceEpochForDateTimeLocal(newValue)) { 1532 setValue(String()); 1533 return; 1534 } 1535 // FIXME: We should specify SecondFormat. 1536 // e.g. If the step value is 60, use SecondFormat::None. 1537 // If the step value is 1, use SecondFormat::Second. 1538 setValue(dateTime.toString()); 1539 return; 1540 } 1529 1541 case NUMBER: 1530 1542 case RANGE: … … 1532 1544 return; 1533 1545 1534 case DATETIMELOCAL: // FIXME: implement ISODateTime.toString()1535 1546 case BUTTON: 1536 1547 case CHECKBOX: -
trunk/WebCore/html/ISODateTime.cpp
r53787 r53964 505 505 } 506 506 507 bool ISODateTime::setMillisecondsSinceEpochForDateTimeLocal(double ms) 508 { 509 // Internal representation of DateTimeLocal is the same as DateTime except m_type. 510 if (!setMillisecondsSinceEpochForDateTime(ms)) 511 return false; 512 m_type = DateTimeLocal; 513 return true; 514 } 515 507 516 bool ISODateTime::setMillisecondsSinceEpochForMonth(double ms) 508 517 { … … 572 581 double ISODateTime::millisecondsSinceEpochForTime() const 573 582 { 574 ASSERT(m_type == Time || m_type == DateTime );583 ASSERT(m_type == Time || m_type == DateTime || m_type == DateTimeLocal); 575 584 return ((m_hour * minutesPerHour + m_minute) * secondsPerMinute + m_second) * msPerSecond + m_millisecond; 576 585 } … … 627 636 return String::format("%04d-%02d-%02dT", m_year, m_month + 1, m_monthDay) 628 637 + toStringForTime(format) + String("Z"); 638 case DateTimeLocal: 639 return String::format("%04d-%02d-%02dT", m_year, m_month + 1, m_monthDay) 640 + toStringForTime(format); 629 641 case Month: 630 642 return String::format("%04d-%02d", m_year, m_month + 1); … … 633 645 case Week: 634 646 return String::format("%04d-W%02d", m_year, m_week); 635 case DateTimeLocal:636 647 case Invalid: 637 648 break; -
trunk/WebCore/html/ISODateTime.h
r53787 r53964 115 115 // For DateTime type. Updates m_year, m_month, m_monthDay, m_hour, m_minute, m_second and m_millisecond. 116 116 bool setMillisecondsSinceEpochForDateTime(double ms); 117 // For DateTimeLocal type. Updates m_year, m_month, m_monthDay, m_hour, m_minute, m_second and m_millisecond. 118 bool setMillisecondsSinceEpochForDateTimeLocal(double ms); 117 119 // For Month type. Updates m_year and m_month. 118 120 bool setMillisecondsSinceEpochForMonth(double ms);
Note: See TracChangeset
for help on using the changeset viewer.