Changeset 54003 in webkit


Ignore:
Timestamp:
Jan 28, 2010 8:47:04 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-28 Kent Tamura <tkent@chromium.org>

Reviewed by Darin Adler.

Rename ISODateTime.{cpp,h} to DateComponents.{cpp,h}
https://bugs.webkit.org/show_bug.cgi?id=34245

No functional changes.

  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • html/DateComponents.cpp: Copied from WebCore/html/ISODateTime.cpp. (WebCore::DateComponents::maxWeekNumberInYear): (WebCore::DateComponents::parseYear): (WebCore::DateComponents::addDay): (WebCore::DateComponents::addMinute): (WebCore::DateComponents::parseTimeZone): (WebCore::DateComponents::parseMonth): (WebCore::DateComponents::parseDate): (WebCore::DateComponents::parseWeek): (WebCore::DateComponents::parseTime): (WebCore::DateComponents::parseDateTimeLocal): (WebCore::DateComponents::parseDateTime): (WebCore::DateComponents::setMillisecondsSinceMidnightInternal): (WebCore::DateComponents::setMillisecondsSinceEpochForDateInternal): (WebCore::DateComponents::setMillisecondsSinceEpochForDate): (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): (WebCore::DateComponents::setMillisecondsSinceEpochForDateTimeLocal): (WebCore::DateComponents::setMillisecondsSinceEpochForMonth): (WebCore::DateComponents::setMillisecondsSinceMidnight): (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): (WebCore::DateComponents::millisecondsSinceEpochForTime): (WebCore::DateComponents::millisecondsSinceEpoch): (WebCore::DateComponents::toStringForTime): (WebCore::DateComponents::toString):
  • html/DateComponents.h: Copied from WebCore/html/ISODateTime.h. (WebCore::DateComponents::DateComponents):
  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseToDouble): (WebCore::HTMLInputElement::valueAsDate): (WebCore::HTMLInputElement::setValueAsDate): (WebCore::HTMLInputElement::setValueAsNumber): (WebCore::HTMLInputElement::formStringToDateComponents):
  • html/HTMLInputElement.h:
  • html/ISODateTime.cpp: Removed.
  • html/ISODateTime.h: Removed.
  • html/ValidityState.cpp: (WebCore::ValidityState::typeMismatch):
Location:
trunk/WebCore
Files:
9 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r54001 r54003  
     12010-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
    1532010-01-28  Alexander Pavlov  <apavlov@chromium.org>
    254
  • trunk/WebCore/GNUmakefile.am

    r53915 r54003  
    981981        WebCore/html/DataGridColumnList.h \
    982982        WebCore/html/DataGridDataSource.h \
     983        WebCore/html/DateComponents.cpp \
     984        WebCore/html/DateComponents.h \
    983985        WebCore/html/DOMDataGridDataSource.cpp \
    984986        WebCore/html/DOMDataGridDataSource.h \
     
    11521154        WebCore/html/HTMLViewSourceDocument.cpp \
    11531155        WebCore/html/HTMLViewSourceDocument.h \
    1154         WebCore/html/ISODateTime.cpp \
    1155         WebCore/html/ISODateTime.h \
    11561156        WebCore/html/ImageData.cpp \
    11571157        WebCore/html/ImageData.h \
  • trunk/WebCore/WebCore.gypi

    r53941 r54003  
    13721372            'html/DataGridColumnList.cpp',
    13731373            'html/DataGridColumnList.h',
     1374            'html/DateComponents.cpp',
     1375            'html/DateComponents.h',
    13741376            'html/File.cpp',
    13751377            'html/File.h',
     
    15481550            'html/HTMLViewSourceDocument.cpp',
    15491551            'html/HTMLViewSourceDocument.h',
    1550             'html/ISODateTime.cpp',
    1551             'html/ISODateTime.h',
    15521552            'html/ImageData.cpp',
    15531553            'html/ImageData.h',
  • trunk/WebCore/WebCore.pro

    r53947 r54003  
    570570    html/DataGridColumn.cpp \
    571571    html/DataGridColumnList.cpp \
     572    html/DateComponents.cpp \
    572573    html/DOMDataGridDataSource.cpp \
    573574    html/File.cpp \
     
    655656    html/HTMLUListElement.cpp \
    656657    html/HTMLViewSourceDocument.cpp \
    657     html/ISODateTime.cpp \
    658658    html/ImageData.cpp \
    659659    html/PreloadScanner.cpp \
     
    12551255    html/DataGridColumn.h \
    12561256    html/DataGridColumnList.h \
     1257    html/DateComponents.h \
    12571258    html/DOMDataGridDataSource.h \
    12581259    html/File.h \
     
    13441345    html/HTMLVideoElement.h \
    13451346    html/HTMLViewSourceDocument.h \
    1346     html/ISODateTime.h \
    13471347    html/ImageData.h \
    13481348    html/PreloadScanner.h \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r53941 r54003  
    2987829878                        </File>
    2987929879                        <File
     29880                                RelativePath="..\html\DateComponents.cpp"
     29881                                >
     29882                        </File>
     29883                        <File
     29884                                RelativePath="..\html\DateComponents.h"
     29885                                >
     29886                        </File>
     29887                        <File
    2988029888                                RelativePath="..\html\DOMDataGridDataSource.cpp"
    2988129889                                >
     
    3407134079                        <File
    3407234080                                RelativePath="..\html\ImageData.h"
    34073                                 >
    34074                         </File>
    34075                         <File
    34076                                 RelativePath="..\html\ISODateTime.cpp"
    34077                                 >
    34078                         </File>
    34079                         <File
    34080                                 RelativePath="..\html\ISODateTime.h"
    3408134081                                >
    3408234082                        </File>
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r53915 r54003  
    48134813                F5C041E60FFCA96D00839D4A /* JSHTMLDataListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5C041E10FFCA96D00839D4A /* JSHTMLDataListElement.cpp */; };
    48144814                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, ); }; };
    48174817                F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; };
    48184818                F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };
     
    1011410114                F5C2869402846DCD018635CA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
    1011510115                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>"; };
    1011810118                F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
    1011910119                F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; };
     
    1273812738                                BC77CF980FF172420070887B /* DataGridColumnList.idl */,
    1273912739                                BCBCAE360FF19385000762AE /* DataGridDataSource.h */,
     12740                                F5D3A57A106B83B300545297 /* DateComponents.cpp */,
     12741                                F5D3A57B106B83B300545297 /* DateComponents.h */,
    1274012742                                BC7DAAEC0FF9615D00CE0138 /* DOMDataGridDataSource.cpp */,
    1274112743                                BC7DAAED0FF9615D00CE0138 /* DOMDataGridDataSource.h */,
     
    1299312995                                BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */,
    1299412996                                BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */,
    12995                                 F5D3A57A106B83B300545297 /* ISODateTime.cpp */,
    12996                                 F5D3A57B106B83B300545297 /* ISODateTime.h */,
    1299712997                                A77979130D6B9D0C003851B9 /* ImageData.cpp */,
    1299812998                                A77979140D6B9D0C003851B9 /* ImageData.h */,
     
    1623616236                                BCBCAE370FF19385000762AE /* DataGridDataSource.h in Headers */,
    1623716237                                BC22746F0E83664500E7F975 /* DataRef.h in Headers */,
     16238                                F5D3A57D106B83B300545297 /* DateComponents.h in Headers */,
    1623816239                                4162A451101145AE00DFF3ED /* DedicatedWorkerContext.h in Headers */,
    1623916240                                41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */,
     
    1719117192                                514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */,
    1719217193                                514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */,
    17193                                 F5D3A57D106B83B300545297 /* ISODateTime.h in Headers */,
    1719417194                                B275356E0B053814002CE64F /* Icon.h in Headers */,
    1719517195                                5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */,
     
    1889518895                                BC77D2390FF298080070887B /* DataGridColumn.cpp in Sources */,
    1889618896                                BC77D1FD0FF28D9B0070887B /* DataGridColumnList.cpp in Sources */,
     18897                                F5D3A57C106B83B300545297 /* DateComponents.cpp in Sources */,
    1889718898                                4162A450101145AE00DFF3ED /* DedicatedWorkerContext.cpp in Sources */,
    1889818899                                41A3D58E101C152D00316D07 /* DedicatedWorkerThread.cpp in Sources */,
     
    1938219383                                0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
    1938319384                                514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
    19384                                 F5D3A57C106B83B300545297 /* ISODateTime.cpp in Sources */,
    1938519385                                5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */,
    1938619386                                445C8DB710015FC90031531A /* IconDatabaseNone.cpp in Sources */,
  • trunk/WebCore/html/DateComponents.cpp

    r54001 r54003  
    3030
    3131#include "config.h"
    32 #include "ISODateTime.h"
     32#include "DateComponents.h"
    3333
    3434#include "PlatformString.h"
     
    5858}
    5959
    60 // `month' is 0-based.
     60// 'month' is 0-based.
    6161static int maxDayOfMonth(int year, int month)
    6262{
     
    6666}
    6767
    68 // `month' is 0-based.
     68// 'month' is 0-based.
    6969static int dayOfWeek(int year, int month, int day)
    7070{
     
    8686}
    8787
    88 int ISODateTime::maxWeekNumberInYear() const
     88int DateComponents::maxWeekNumberInYear() const
    8989{
    9090    int day = dayOfWeek(m_year, 0, 1); // January 1.
     
    124124}
    125125
    126 bool ISODateTime::parseYear(const UChar* src, unsigned length, unsigned start, unsigned& end)
     126bool DateComponents::parseYear(const UChar* src, unsigned length, unsigned start, unsigned& end)
    127127{
    128128    unsigned digitsLength = countDigits(src, length, start);
     
    148148}
    149149
    150 bool ISODateTime::addDay(int dayDiff)
     150bool DateComponents::addDay(int dayDiff)
    151151{
    152152    ASSERT(m_monthDay);
     
    198198}
    199199
    200 bool ISODateTime::addMinute(int minute)
     200bool DateComponents::addMinute(int minute)
    201201{
    202202    int carry;
     
    238238
    239239// 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)
     240bool DateComponents::parseTimeZone(const UChar* src, unsigned length, unsigned start, unsigned& end)
    241241{
    242242    if (start >= length)
     
    283283}
    284284
    285 bool ISODateTime::parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end)
     285bool DateComponents::parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end)
    286286{
    287287    ASSERT(src);
     
    306306}
    307307
    308 bool ISODateTime::parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end)
     308bool DateComponents::parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end)
    309309{
    310310    ASSERT(src);
     
    331331}
    332332
    333 bool ISODateTime::parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end)
     333bool DateComponents::parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end)
    334334{
    335335    ASSERT(src);
     
    360360}
    361361
    362 bool ISODateTime::parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end)
     362bool DateComponents::parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end)
    363363{
    364364    ASSERT(src);
     
    415415}
    416416
    417 bool ISODateTime::parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end)
     417bool DateComponents::parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end)
    418418{
    419419    ASSERT(src);
     
    432432}
    433433
    434 bool ISODateTime::parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end)
     434bool DateComponents::parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end)
    435435{
    436436    ASSERT(src);
     
    457457}
    458458
    459 void ISODateTime::setMillisecondsSinceMidnightInternal(double msInDay)
     459void DateComponents::setMillisecondsSinceMidnightInternal(double msInDay)
    460460{
    461461    ASSERT(msInDay >= 0 && msInDay < msPerDay);
     
    468468}
    469469
    470 bool ISODateTime::setMillisecondsSinceEpochForDateInternal(double ms)
     470bool DateComponents::setMillisecondsSinceEpochForDateInternal(double ms)
    471471{
    472472    m_year = msToYear(ms);
     
    477477}
    478478
    479 bool ISODateTime::setMillisecondsSinceEpochForDate(double ms)
     479bool DateComponents::setMillisecondsSinceEpochForDate(double ms)
    480480{
    481481    m_type = Invalid;
     
    490490}
    491491
    492 bool ISODateTime::setMillisecondsSinceEpochForDateTime(double ms)
     492bool DateComponents::setMillisecondsSinceEpochForDateTime(double ms)
    493493{
    494494    m_type = Invalid;
     
    505505}
    506506
    507 bool ISODateTime::setMillisecondsSinceEpochForDateTimeLocal(double ms)
     507bool DateComponents::setMillisecondsSinceEpochForDateTimeLocal(double ms)
    508508{
    509509    // Internal representation of DateTimeLocal is the same as DateTime except m_type.
     
    514514}
    515515
    516 bool ISODateTime::setMillisecondsSinceEpochForMonth(double ms)
     516bool DateComponents::setMillisecondsSinceEpochForMonth(double ms)
    517517{
    518518    m_type = Invalid;
     
    528528}
    529529
    530 bool ISODateTime::setMillisecondsSinceMidnight(double ms)
     530bool DateComponents::setMillisecondsSinceMidnight(double ms)
    531531{
    532532    m_type = Invalid;
     
    548548}
    549549
    550 bool ISODateTime::setMillisecondsSinceEpochForWeek(double ms)
     550bool DateComponents::setMillisecondsSinceEpochForWeek(double ms)
    551551{
    552552    m_type = Invalid;
     
    579579}
    580580
    581 double ISODateTime::millisecondsSinceEpochForTime() const
     581double DateComponents::millisecondsSinceEpochForTime() const
    582582{
    583583    ASSERT(m_type == Time || m_type == DateTime || m_type == DateTimeLocal);
     
    585585}
    586586
    587 double ISODateTime::millisecondsSinceEpoch() const
     587double DateComponents::millisecondsSinceEpoch() const
    588588{
    589589    switch (m_type) {
     
    606606}
    607607
    608 String ISODateTime::toStringForTime(SecondFormat format) const
     608String DateComponents::toStringForTime(SecondFormat format) const
    609609{
    610610    ASSERT(m_type == DateTime || m_type == DateTimeLocal || m_type == Time);
     
    628628}
    629629
    630 String ISODateTime::toString(SecondFormat format) const
     630String DateComponents::toString(SecondFormat format) const
    631631{
    632632    switch (m_type) {
     
    649649    }
    650650    ASSERT_NOT_REACHED();
    651     return String("(Invalid ISODateTime)");
     651    return String("(Invalid DateComponents)");
    652652}
    653653
  • trunk/WebCore/html/DateComponents.h

    r54001 r54003  
    2929 */
    3030
    31 #ifndef ISODateTime_h
    32 #define ISODateTime_h
     31#ifndef DateComponents_h
     32#define DateComponents_h
    3333
    3434#include <limits>
     
    3939class String;
    4040
    41 // An ISODateTime instance represents one of the following date and time combinations:
     41// A DateComponents instance represents one of the following date and time combinations:
    4242// * Month type: year-month
    4343// * Date type: year-month-day
     
    4545// * Time type: hour-minute-second-millisecond
    4646// * DateTime or DateTimeLocal type: year-month-day hour-minute-second-millisecond
    47 class ISODateTime {
     47class DateComponents {
    4848public:
    49     ISODateTime()
     49    DateComponents()
    5050        : m_millisecond(0)
    5151        , m_second(0)
     
    8080
    8181    // parse*() and setMillisecondsSince*() functions are initializers for an
    82     // ISODateTime instance. If these functions return false, the instance
     82    // DateComponents instance. If these functions return false, the instance
    8383    // might be invalid.
    8484
     
    108108    // the number of milliseconds since 1970-01-01 00:00:00.000 UTC as
    109109    // the argument, and update all fields for the corresponding
    110     // ISODateTime type. The functions return true if it succeeds, and
     110    // DateComponents type. The functions return true if it succeeds, and
    111111    // false if they fail.
    112112
     
    126126
    127127    // Returns the number of milliseconds from 1970-01-01 00:00:00 UTC.
    128     // For an ISODateTime initialized with parseDateTimeLocal(),
     128    // For a DateComponents initialized with parseDateTimeLocal(),
    129129    // millisecondsSinceEpoch() returns a value for UTC timezone.
    130130    double millisecondsSinceEpoch() const;
     
    132132
    133133private:
    134     // Returns the maximum week number in this ISODateTime's year.
     134    // Returns the maximum week number in this DateComponents's year.
    135135    // The result is either of 52 and 53.
    136136    int maxWeekNumberInYear() const;
     
    158158    };
    159159
    160     int m_millisecond;  // 0 - 999
     160    int m_millisecond; // 0 - 999
    161161    int m_second;
    162162    int m_minute;
    163163    int m_hour;
    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
     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
    168168
    169169    enum Type {
     
    182182} // namespace WebCore
    183183
    184 #endif // ISODateTime_h
     184#endif // DateComponents_h
  • trunk/WebCore/html/HTMLInputElement.cpp

    r53975 r54003  
    3030#include "CSSPropertyNames.h"
    3131#include "ChromeClient.h"
     32#include "DateComponents.h"
    3233#include "Document.h"
    3334#include "Editor.h"
     
    4647#include "HTMLNames.h"
    4748#include "HTMLOptionElement.h"
    48 #include "ISODateTime.h"
    4949#include "ScriptEventListener.h"
    5050#include "KeyboardEvent.h"
     
    14931493    case TIME:
    14941494    case WEEK: {
    1495         ISODateTime dateTime;
    1496         if (!formStringToISODateTime(inputType(), src, &dateTime))
     1495        DateComponents date;
     1496        if (!formStringToDateComponents(inputType(), src, &date))
    14971497            return defaultValue;
    1498         double msec = dateTime.millisecondsSinceEpoch();
     1498        double msec = date.millisecondsSinceEpoch();
    14991499        ASSERT(isfinite(msec));
    15001500        return msec;
     
    15391539    case TIME:
    15401540    case WEEK:
    1541         return parseToDouble(value(), ISODateTime::invalidMilliseconds());
     1541        return parseToDouble(value(), DateComponents::invalidMilliseconds());
    15421542
    15431543    case BUTTON:
     
    15601560    case TEXT:
    15611561    case URL:
    1562         return ISODateTime::invalidMilliseconds();
     1562        return DateComponents::invalidMilliseconds();
    15631563    }
    15641564    ASSERT_NOT_REACHED();
    1565     return ISODateTime::invalidMilliseconds();
     1565    return DateComponents::invalidMilliseconds();
    15661566}
    15671567
    15681568void HTMLInputElement::setValueAsDate(double value, ExceptionCode& ec)
    15691569{
    1570     ISODateTime dateTime;
     1570    DateComponents date;
    15711571    bool success;
    15721572    switch (inputType()) {
    15731573    case DATE:
    1574         success = dateTime.setMillisecondsSinceEpochForDate(value);
     1574        success = date.setMillisecondsSinceEpochForDate(value);
    15751575        break;
    15761576    case DATETIME:
    1577         success = dateTime.setMillisecondsSinceEpochForDateTime(value);
     1577        success = date.setMillisecondsSinceEpochForDateTime(value);
    15781578        break;
    15791579    case MONTH:
    1580         success = dateTime.setMillisecondsSinceEpochForMonth(value);
     1580        success = date.setMillisecondsSinceEpochForMonth(value);
    15811581        break;
    15821582    case TIME:
    1583         success = dateTime.setMillisecondsSinceMidnight(value);
     1583        success = date.setMillisecondsSinceMidnight(value);
    15841584        break;
    15851585    case WEEK:
    1586         success = dateTime.setMillisecondsSinceEpochForWeek(value);
     1586        success = date.setMillisecondsSinceEpochForWeek(value);
    15871587        break;
    15881588    case BUTTON:
     
    16181618    // e.g. If the step value is 60, use SecondFormat::None.
    16191619    //      If the step value is 1, use SecondFormat::Second.
    1620     setValue(dateTime.toString());
     1620    setValue(date.toString());
    16211621}
    16221622
     
    16721672        return;
    16731673    case DATETIMELOCAL: {
    1674         ISODateTime dateTime;
    1675         if (!dateTime.setMillisecondsSinceEpochForDateTimeLocal(newValue)) {
     1674        DateComponents date;
     1675        if (!date.setMillisecondsSinceEpochForDateTimeLocal(newValue)) {
    16761676            setValue(String());
    16771677            return;
     
    16801680        // e.g. If the step value is 60, use SecondFormat::None.
    16811681        //      If the step value is 1, use SecondFormat::Second.
    1682         setValue(dateTime.toString());
     1682        setValue(date.toString());
    16831683        return;
    16841684    }
     
    24492449}
    24502450
    2451 bool HTMLInputElement::formStringToISODateTime(InputType type, const String& formString, ISODateTime* out)
     2451bool HTMLInputElement::formStringToDateComponents(InputType type, const String& formString, DateComponents* out)
    24522452{
    24532453    if (formString.isEmpty())
    24542454        return false;
    2455     ISODateTime ignoredResult;
     2455    DateComponents ignoredResult;
    24562456    if (!out)
    24572457        out = &ignoredResult;
  • trunk/WebCore/html/HTMLInputElement.h

    r53975 r54003  
    3131namespace WebCore {
    3232
     33class DateComponents;
    3334class FileList;
    3435class HTMLDataListElement;
    3536class HTMLImageLoader;
    3637class HTMLOptionElement;
    37 class ISODateTime;
    3838class KURL;
    3939class VisibleSelection;
     
    268268    static String formStringFromDouble(double);
    269269    // 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 be
    271     // modified even if the parsing fails.  The ISODateTime* parameter may be 0.
    272     static bool formStringToISODateTime(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*);
    273273   
    274274protected:
  • trunk/WebCore/html/ValidityState.cpp

    r53364 r54003  
    101101    case HTMLInputElement::TIME:
    102102    case HTMLInputElement::WEEK:
    103         return !HTMLInputElement::formStringToISODateTime(input->inputType(), value, 0);
     103        return !HTMLInputElement::formStringToDateComponents(input->inputType(), value, 0);
    104104    case HTMLInputElement::BUTTON:
    105105    case HTMLInputElement::CHECKBOX:
Note: See TracChangeset for help on using the changeset viewer.