Changeset 54003 in webkit
- Timestamp:
- Jan 28, 2010 8:47:04 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 9 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54001 r54003 1 2010-01-28 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Rename ISODateTime.{cpp,h} to DateComponents.{cpp,h} 6 https://bugs.webkit.org/show_bug.cgi?id=34245 7 8 No functional changes. 9 10 * GNUmakefile.am: 11 * WebCore.gypi: 12 * WebCore.pro: 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * html/DateComponents.cpp: Copied from WebCore/html/ISODateTime.cpp. 16 (WebCore::DateComponents::maxWeekNumberInYear): 17 (WebCore::DateComponents::parseYear): 18 (WebCore::DateComponents::addDay): 19 (WebCore::DateComponents::addMinute): 20 (WebCore::DateComponents::parseTimeZone): 21 (WebCore::DateComponents::parseMonth): 22 (WebCore::DateComponents::parseDate): 23 (WebCore::DateComponents::parseWeek): 24 (WebCore::DateComponents::parseTime): 25 (WebCore::DateComponents::parseDateTimeLocal): 26 (WebCore::DateComponents::parseDateTime): 27 (WebCore::DateComponents::setMillisecondsSinceMidnightInternal): 28 (WebCore::DateComponents::setMillisecondsSinceEpochForDateInternal): 29 (WebCore::DateComponents::setMillisecondsSinceEpochForDate): 30 (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): 31 (WebCore::DateComponents::setMillisecondsSinceEpochForDateTimeLocal): 32 (WebCore::DateComponents::setMillisecondsSinceEpochForMonth): 33 (WebCore::DateComponents::setMillisecondsSinceMidnight): 34 (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): 35 (WebCore::DateComponents::millisecondsSinceEpochForTime): 36 (WebCore::DateComponents::millisecondsSinceEpoch): 37 (WebCore::DateComponents::toStringForTime): 38 (WebCore::DateComponents::toString): 39 * html/DateComponents.h: Copied from WebCore/html/ISODateTime.h. 40 (WebCore::DateComponents::DateComponents): 41 * html/HTMLInputElement.cpp: 42 (WebCore::HTMLInputElement::parseToDouble): 43 (WebCore::HTMLInputElement::valueAsDate): 44 (WebCore::HTMLInputElement::setValueAsDate): 45 (WebCore::HTMLInputElement::setValueAsNumber): 46 (WebCore::HTMLInputElement::formStringToDateComponents): 47 * html/HTMLInputElement.h: 48 * html/ISODateTime.cpp: Removed. 49 * html/ISODateTime.h: Removed. 50 * html/ValidityState.cpp: 51 (WebCore::ValidityState::typeMismatch): 52 1 53 2010-01-28 Alexander Pavlov <apavlov@chromium.org> 2 54 -
trunk/WebCore/GNUmakefile.am
r53915 r54003 981 981 WebCore/html/DataGridColumnList.h \ 982 982 WebCore/html/DataGridDataSource.h \ 983 WebCore/html/DateComponents.cpp \ 984 WebCore/html/DateComponents.h \ 983 985 WebCore/html/DOMDataGridDataSource.cpp \ 984 986 WebCore/html/DOMDataGridDataSource.h \ … … 1152 1154 WebCore/html/HTMLViewSourceDocument.cpp \ 1153 1155 WebCore/html/HTMLViewSourceDocument.h \ 1154 WebCore/html/ISODateTime.cpp \1155 WebCore/html/ISODateTime.h \1156 1156 WebCore/html/ImageData.cpp \ 1157 1157 WebCore/html/ImageData.h \ -
trunk/WebCore/WebCore.gypi
r53941 r54003 1372 1372 'html/DataGridColumnList.cpp', 1373 1373 'html/DataGridColumnList.h', 1374 'html/DateComponents.cpp', 1375 'html/DateComponents.h', 1374 1376 'html/File.cpp', 1375 1377 'html/File.h', … … 1548 1550 'html/HTMLViewSourceDocument.cpp', 1549 1551 'html/HTMLViewSourceDocument.h', 1550 'html/ISODateTime.cpp',1551 'html/ISODateTime.h',1552 1552 'html/ImageData.cpp', 1553 1553 'html/ImageData.h', -
trunk/WebCore/WebCore.pro
r53947 r54003 570 570 html/DataGridColumn.cpp \ 571 571 html/DataGridColumnList.cpp \ 572 html/DateComponents.cpp \ 572 573 html/DOMDataGridDataSource.cpp \ 573 574 html/File.cpp \ … … 655 656 html/HTMLUListElement.cpp \ 656 657 html/HTMLViewSourceDocument.cpp \ 657 html/ISODateTime.cpp \658 658 html/ImageData.cpp \ 659 659 html/PreloadScanner.cpp \ … … 1255 1255 html/DataGridColumn.h \ 1256 1256 html/DataGridColumnList.h \ 1257 html/DateComponents.h \ 1257 1258 html/DOMDataGridDataSource.h \ 1258 1259 html/File.h \ … … 1344 1345 html/HTMLVideoElement.h \ 1345 1346 html/HTMLViewSourceDocument.h \ 1346 html/ISODateTime.h \1347 1347 html/ImageData.h \ 1348 1348 html/PreloadScanner.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r53941 r54003 29878 29878 </File> 29879 29879 <File 29880 RelativePath="..\html\DateComponents.cpp" 29881 > 29882 </File> 29883 <File 29884 RelativePath="..\html\DateComponents.h" 29885 > 29886 </File> 29887 <File 29880 29888 RelativePath="..\html\DOMDataGridDataSource.cpp" 29881 29889 > … … 34071 34079 <File 34072 34080 RelativePath="..\html\ImageData.h" 34073 >34074 </File>34075 <File34076 RelativePath="..\html\ISODateTime.cpp"34077 >34078 </File>34079 <File34080 RelativePath="..\html\ISODateTime.h"34081 34081 > 34082 34082 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r53915 r54003 4813 4813 F5C041E60FFCA96D00839D4A /* JSHTMLDataListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5C041E10FFCA96D00839D4A /* JSHTMLDataListElement.cpp */; }; 4814 4814 F5C041E70FFCA96D00839D4A /* JSHTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041E20FFCA96D00839D4A /* JSHTMLDataListElement.h */; }; 4815 F5D3A57C106B83B300545297 /* ISODateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D3A57A106B83B300545297 /* ISODateTime.cpp */; };4816 F5D3A57D106B83B300545297 /* ISODateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = F5D3A57B106B83B300545297 /* ISODateTime.h */; settings = {ATTRIBUTES = (Private, ); }; };4815 F5D3A57C106B83B300545297 /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D3A57A106B83B300545297 /* DateComponents.cpp */; }; 4816 F5D3A57D106B83B300545297 /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = F5D3A57B106B83B300545297 /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4817 4817 F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; }; 4818 4818 F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; }; … … 10114 10114 F5C2869402846DCD018635CA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; 10115 10115 F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 10116 F5D3A57A106B83B300545297 /* ISODateTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ISODateTime.cpp; sourceTree = "<group>"; };10117 F5D3A57B106B83B300545297 /* ISODateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISODateTime.h; sourceTree = "<group>"; };10116 F5D3A57A106B83B300545297 /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; }; 10117 F5D3A57B106B83B300545297 /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; }; 10118 10118 F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 10119 10119 F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; }; … … 12738 12738 BC77CF980FF172420070887B /* DataGridColumnList.idl */, 12739 12739 BCBCAE360FF19385000762AE /* DataGridDataSource.h */, 12740 F5D3A57A106B83B300545297 /* DateComponents.cpp */, 12741 F5D3A57B106B83B300545297 /* DateComponents.h */, 12740 12742 BC7DAAEC0FF9615D00CE0138 /* DOMDataGridDataSource.cpp */, 12741 12743 BC7DAAED0FF9615D00CE0138 /* DOMDataGridDataSource.h */, … … 12993 12995 BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */, 12994 12996 BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */, 12995 F5D3A57A106B83B300545297 /* ISODateTime.cpp */,12996 F5D3A57B106B83B300545297 /* ISODateTime.h */,12997 12997 A77979130D6B9D0C003851B9 /* ImageData.cpp */, 12998 12998 A77979140D6B9D0C003851B9 /* ImageData.h */, … … 16236 16236 BCBCAE370FF19385000762AE /* DataGridDataSource.h in Headers */, 16237 16237 BC22746F0E83664500E7F975 /* DataRef.h in Headers */, 16238 F5D3A57D106B83B300545297 /* DateComponents.h in Headers */, 16238 16239 4162A451101145AE00DFF3ED /* DedicatedWorkerContext.h in Headers */, 16239 16240 41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */, … … 17191 17192 514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */, 17192 17193 514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */, 17193 F5D3A57D106B83B300545297 /* ISODateTime.h in Headers */,17194 17194 B275356E0B053814002CE64F /* Icon.h in Headers */, 17195 17195 5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */, … … 18895 18895 BC77D2390FF298080070887B /* DataGridColumn.cpp in Sources */, 18896 18896 BC77D1FD0FF28D9B0070887B /* DataGridColumnList.cpp in Sources */, 18897 F5D3A57C106B83B300545297 /* DateComponents.cpp in Sources */, 18897 18898 4162A450101145AE00DFF3ED /* DedicatedWorkerContext.cpp in Sources */, 18898 18899 41A3D58E101C152D00316D07 /* DedicatedWorkerThread.cpp in Sources */, … … 19382 19383 0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */, 19383 19384 514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */, 19384 F5D3A57C106B83B300545297 /* ISODateTime.cpp in Sources */,19385 19385 5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */, 19386 19386 445C8DB710015FC90031531A /* IconDatabaseNone.cpp in Sources */, -
trunk/WebCore/html/DateComponents.cpp
r54001 r54003 30 30 31 31 #include "config.h" 32 #include " ISODateTime.h"32 #include "DateComponents.h" 33 33 34 34 #include "PlatformString.h" … … 58 58 } 59 59 60 // `month' is 0-based.60 // 'month' is 0-based. 61 61 static int maxDayOfMonth(int year, int month) 62 62 { … … 66 66 } 67 67 68 // `month' is 0-based.68 // 'month' is 0-based. 69 69 static int dayOfWeek(int year, int month, int day) 70 70 { … … 86 86 } 87 87 88 int ISODateTime::maxWeekNumberInYear() const88 int DateComponents::maxWeekNumberInYear() const 89 89 { 90 90 int day = dayOfWeek(m_year, 0, 1); // January 1. … … 124 124 } 125 125 126 bool ISODateTime::parseYear(const UChar* src, unsigned length, unsigned start, unsigned& end)126 bool DateComponents::parseYear(const UChar* src, unsigned length, unsigned start, unsigned& end) 127 127 { 128 128 unsigned digitsLength = countDigits(src, length, start); … … 148 148 } 149 149 150 bool ISODateTime::addDay(int dayDiff)150 bool DateComponents::addDay(int dayDiff) 151 151 { 152 152 ASSERT(m_monthDay); … … 198 198 } 199 199 200 bool ISODateTime::addMinute(int minute)200 bool DateComponents::addMinute(int minute) 201 201 { 202 202 int carry; … … 238 238 239 239 // Parses a timezone part, and adjust year, month, monthDay, hour, minute, second, millisecond. 240 bool ISODateTime::parseTimeZone(const UChar* src, unsigned length, unsigned start, unsigned& end)240 bool DateComponents::parseTimeZone(const UChar* src, unsigned length, unsigned start, unsigned& end) 241 241 { 242 242 if (start >= length) … … 283 283 } 284 284 285 bool ISODateTime::parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end)285 bool DateComponents::parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end) 286 286 { 287 287 ASSERT(src); … … 306 306 } 307 307 308 bool ISODateTime::parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end)308 bool DateComponents::parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end) 309 309 { 310 310 ASSERT(src); … … 331 331 } 332 332 333 bool ISODateTime::parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end)333 bool DateComponents::parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end) 334 334 { 335 335 ASSERT(src); … … 360 360 } 361 361 362 bool ISODateTime::parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end)362 bool DateComponents::parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end) 363 363 { 364 364 ASSERT(src); … … 415 415 } 416 416 417 bool ISODateTime::parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end)417 bool DateComponents::parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end) 418 418 { 419 419 ASSERT(src); … … 432 432 } 433 433 434 bool ISODateTime::parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end)434 bool DateComponents::parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end) 435 435 { 436 436 ASSERT(src); … … 457 457 } 458 458 459 void ISODateTime::setMillisecondsSinceMidnightInternal(double msInDay)459 void DateComponents::setMillisecondsSinceMidnightInternal(double msInDay) 460 460 { 461 461 ASSERT(msInDay >= 0 && msInDay < msPerDay); … … 468 468 } 469 469 470 bool ISODateTime::setMillisecondsSinceEpochForDateInternal(double ms)470 bool DateComponents::setMillisecondsSinceEpochForDateInternal(double ms) 471 471 { 472 472 m_year = msToYear(ms); … … 477 477 } 478 478 479 bool ISODateTime::setMillisecondsSinceEpochForDate(double ms)479 bool DateComponents::setMillisecondsSinceEpochForDate(double ms) 480 480 { 481 481 m_type = Invalid; … … 490 490 } 491 491 492 bool ISODateTime::setMillisecondsSinceEpochForDateTime(double ms)492 bool DateComponents::setMillisecondsSinceEpochForDateTime(double ms) 493 493 { 494 494 m_type = Invalid; … … 505 505 } 506 506 507 bool ISODateTime::setMillisecondsSinceEpochForDateTimeLocal(double ms)507 bool DateComponents::setMillisecondsSinceEpochForDateTimeLocal(double ms) 508 508 { 509 509 // Internal representation of DateTimeLocal is the same as DateTime except m_type. … … 514 514 } 515 515 516 bool ISODateTime::setMillisecondsSinceEpochForMonth(double ms)516 bool DateComponents::setMillisecondsSinceEpochForMonth(double ms) 517 517 { 518 518 m_type = Invalid; … … 528 528 } 529 529 530 bool ISODateTime::setMillisecondsSinceMidnight(double ms)530 bool DateComponents::setMillisecondsSinceMidnight(double ms) 531 531 { 532 532 m_type = Invalid; … … 548 548 } 549 549 550 bool ISODateTime::setMillisecondsSinceEpochForWeek(double ms)550 bool DateComponents::setMillisecondsSinceEpochForWeek(double ms) 551 551 { 552 552 m_type = Invalid; … … 579 579 } 580 580 581 double ISODateTime::millisecondsSinceEpochForTime() const581 double DateComponents::millisecondsSinceEpochForTime() const 582 582 { 583 583 ASSERT(m_type == Time || m_type == DateTime || m_type == DateTimeLocal); … … 585 585 } 586 586 587 double ISODateTime::millisecondsSinceEpoch() const587 double DateComponents::millisecondsSinceEpoch() const 588 588 { 589 589 switch (m_type) { … … 606 606 } 607 607 608 String ISODateTime::toStringForTime(SecondFormat format) const608 String DateComponents::toStringForTime(SecondFormat format) const 609 609 { 610 610 ASSERT(m_type == DateTime || m_type == DateTimeLocal || m_type == Time); … … 628 628 } 629 629 630 String ISODateTime::toString(SecondFormat format) const630 String DateComponents::toString(SecondFormat format) const 631 631 { 632 632 switch (m_type) { … … 649 649 } 650 650 ASSERT_NOT_REACHED(); 651 return String("(Invalid ISODateTime)");651 return String("(Invalid DateComponents)"); 652 652 } 653 653 -
trunk/WebCore/html/DateComponents.h
r54001 r54003 29 29 */ 30 30 31 #ifndef ISODateTime_h32 #define ISODateTime_h31 #ifndef DateComponents_h 32 #define DateComponents_h 33 33 34 34 #include <limits> … … 39 39 class String; 40 40 41 // A n ISODateTimeinstance represents one of the following date and time combinations:41 // A DateComponents instance represents one of the following date and time combinations: 42 42 // * Month type: year-month 43 43 // * Date type: year-month-day … … 45 45 // * Time type: hour-minute-second-millisecond 46 46 // * DateTime or DateTimeLocal type: year-month-day hour-minute-second-millisecond 47 class ISODateTime{47 class DateComponents { 48 48 public: 49 ISODateTime()49 DateComponents() 50 50 : m_millisecond(0) 51 51 , m_second(0) … … 80 80 81 81 // parse*() and setMillisecondsSince*() functions are initializers for an 82 // ISODateTimeinstance. If these functions return false, the instance82 // DateComponents instance. If these functions return false, the instance 83 83 // might be invalid. 84 84 … … 108 108 // the number of milliseconds since 1970-01-01 00:00:00.000 UTC as 109 109 // the argument, and update all fields for the corresponding 110 // ISODateTimetype. The functions return true if it succeeds, and110 // DateComponents type. The functions return true if it succeeds, and 111 111 // false if they fail. 112 112 … … 126 126 127 127 // Returns the number of milliseconds from 1970-01-01 00:00:00 UTC. 128 // For a n ISODateTimeinitialized with parseDateTimeLocal(),128 // For a DateComponents initialized with parseDateTimeLocal(), 129 129 // millisecondsSinceEpoch() returns a value for UTC timezone. 130 130 double millisecondsSinceEpoch() const; … … 132 132 133 133 private: 134 // Returns the maximum week number in this ISODateTime's year.134 // Returns the maximum week number in this DateComponents's year. 135 135 // The result is either of 52 and 53. 136 136 int maxWeekNumberInYear() const; … … 158 158 }; 159 159 160 int m_millisecond; 160 int m_millisecond; // 0 - 999 161 161 int m_second; 162 162 int m_minute; 163 163 int m_hour; 164 int m_monthDay; 165 int m_month; 166 int m_year; 167 int m_week; 164 int m_monthDay; // 1 - 31 165 int m_month; // 0:January - 11:December 166 int m_year; // 1582 - 167 int m_week; // 1 - 53 168 168 169 169 enum Type { … … 182 182 } // namespace WebCore 183 183 184 #endif // ISODateTime_h184 #endif // DateComponents_h -
trunk/WebCore/html/HTMLInputElement.cpp
r53975 r54003 30 30 #include "CSSPropertyNames.h" 31 31 #include "ChromeClient.h" 32 #include "DateComponents.h" 32 33 #include "Document.h" 33 34 #include "Editor.h" … … 46 47 #include "HTMLNames.h" 47 48 #include "HTMLOptionElement.h" 48 #include "ISODateTime.h"49 49 #include "ScriptEventListener.h" 50 50 #include "KeyboardEvent.h" … … 1493 1493 case TIME: 1494 1494 case WEEK: { 1495 ISODateTime dateTime;1496 if (!formStringTo ISODateTime(inputType(), src, &dateTime))1495 DateComponents date; 1496 if (!formStringToDateComponents(inputType(), src, &date)) 1497 1497 return defaultValue; 1498 double msec = date Time.millisecondsSinceEpoch();1498 double msec = date.millisecondsSinceEpoch(); 1499 1499 ASSERT(isfinite(msec)); 1500 1500 return msec; … … 1539 1539 case TIME: 1540 1540 case WEEK: 1541 return parseToDouble(value(), ISODateTime::invalidMilliseconds());1541 return parseToDouble(value(), DateComponents::invalidMilliseconds()); 1542 1542 1543 1543 case BUTTON: … … 1560 1560 case TEXT: 1561 1561 case URL: 1562 return ISODateTime::invalidMilliseconds();1562 return DateComponents::invalidMilliseconds(); 1563 1563 } 1564 1564 ASSERT_NOT_REACHED(); 1565 return ISODateTime::invalidMilliseconds();1565 return DateComponents::invalidMilliseconds(); 1566 1566 } 1567 1567 1568 1568 void HTMLInputElement::setValueAsDate(double value, ExceptionCode& ec) 1569 1569 { 1570 ISODateTime dateTime;1570 DateComponents date; 1571 1571 bool success; 1572 1572 switch (inputType()) { 1573 1573 case DATE: 1574 success = date Time.setMillisecondsSinceEpochForDate(value);1574 success = date.setMillisecondsSinceEpochForDate(value); 1575 1575 break; 1576 1576 case DATETIME: 1577 success = date Time.setMillisecondsSinceEpochForDateTime(value);1577 success = date.setMillisecondsSinceEpochForDateTime(value); 1578 1578 break; 1579 1579 case MONTH: 1580 success = date Time.setMillisecondsSinceEpochForMonth(value);1580 success = date.setMillisecondsSinceEpochForMonth(value); 1581 1581 break; 1582 1582 case TIME: 1583 success = date Time.setMillisecondsSinceMidnight(value);1583 success = date.setMillisecondsSinceMidnight(value); 1584 1584 break; 1585 1585 case WEEK: 1586 success = date Time.setMillisecondsSinceEpochForWeek(value);1586 success = date.setMillisecondsSinceEpochForWeek(value); 1587 1587 break; 1588 1588 case BUTTON: … … 1618 1618 // e.g. If the step value is 60, use SecondFormat::None. 1619 1619 // If the step value is 1, use SecondFormat::Second. 1620 setValue(date Time.toString());1620 setValue(date.toString()); 1621 1621 } 1622 1622 … … 1672 1672 return; 1673 1673 case DATETIMELOCAL: { 1674 ISODateTime dateTime;1675 if (!date Time.setMillisecondsSinceEpochForDateTimeLocal(newValue)) {1674 DateComponents date; 1675 if (!date.setMillisecondsSinceEpochForDateTimeLocal(newValue)) { 1676 1676 setValue(String()); 1677 1677 return; … … 1680 1680 // e.g. If the step value is 60, use SecondFormat::None. 1681 1681 // If the step value is 1, use SecondFormat::Second. 1682 setValue(date Time.toString());1682 setValue(date.toString()); 1683 1683 return; 1684 1684 } … … 2449 2449 } 2450 2450 2451 bool HTMLInputElement::formStringTo ISODateTime(InputType type, const String& formString, ISODateTime* out)2451 bool HTMLInputElement::formStringToDateComponents(InputType type, const String& formString, DateComponents* out) 2452 2452 { 2453 2453 if (formString.isEmpty()) 2454 2454 return false; 2455 ISODateTimeignoredResult;2455 DateComponents ignoredResult; 2456 2456 if (!out) 2457 2457 out = &ignoredResult; -
trunk/WebCore/html/HTMLInputElement.h
r53975 r54003 31 31 namespace WebCore { 32 32 33 class DateComponents; 33 34 class FileList; 34 35 class HTMLDataListElement; 35 36 class HTMLImageLoader; 36 37 class HTMLOptionElement; 37 class ISODateTime;38 38 class KURL; 39 39 class VisibleSelection; … … 268 268 static String formStringFromDouble(double); 269 269 // Parses the specified string as the InputType, and returns true if it is successfully parsed. 270 // An instance pointed by the ISODateTime* parameter will have parsed values and be271 // modified even if the parsing fails. The ISODateTime* parameter may be 0.272 static bool formStringTo ISODateTime(InputType, const String&, ISODateTime*);270 // An instance pointed by the DateComponents* parameter will have parsed values and be 271 // modified even if the parsing fails. The DateComponents* parameter may be 0. 272 static bool formStringToDateComponents(InputType, const String&, DateComponents*); 273 273 274 274 protected: -
trunk/WebCore/html/ValidityState.cpp
r53364 r54003 101 101 case HTMLInputElement::TIME: 102 102 case HTMLInputElement::WEEK: 103 return !HTMLInputElement::formStringTo ISODateTime(input->inputType(), value, 0);103 return !HTMLInputElement::formStringToDateComponents(input->inputType(), value, 0); 104 104 case HTMLInputElement::BUTTON: 105 105 case HTMLInputElement::CHECKBOX:
Note: See TracChangeset
for help on using the changeset viewer.