Changeset 51063 in webkit


Ignore:
Timestamp:
Nov 16, 2009 9:13:08 PM (14 years ago)
Author:
tkent@chromium.org
Message:

2009-11-16 Kent Tamura <tkent@chromium.org>

Reviewed by David Levin.

Introduce WebCore::ISODateTime class.
https://bugs.webkit.org/show_bug.cgi?id=31340

This class represents a value of date/time types of the HTML5 INPUT
element, and has some parsing methods for ISO 8601.

This change has no tests because the class is not used yet.

  • GNUmakefile.am: Add ISODateTime.cpp and ISODateTime.h.
  • WebCore.gypi: ditto.
  • WebCore.pro: ditto.
  • WebCore.vcproj/WebCore.vcproj: ditto.
  • WebCore.xcodeproj/project.pbxproj: ditto.
  • WebCoreSources.bkl: ditto.
  • html/ISODateTime.cpp: Added. Implementation of WebCore::ISODateTime class. (WebCore::isLeapYear): (WebCore::maxDayOfMonth): (WebCore::dayOfWeek): (WebCore::ISODateTime::maxWeekNumberInYear): (WebCore::countDigits): (WebCore::toInt): (WebCore::ISODateTime::parseYear): Private helper for parseDate() and parseWeek(). (WebCore::ISODateTime::addDay): Private helper for parseTimeZone(). (WebCore::ISODateTime::addMinute): ditto. (WebCore::ISODateTime::parseTimeZone): Private helper for parseDateTime(). (WebCore::ISODateTime::parseMonth): Parser for <input type=month>. (WebCore::ISODateTime::parseDate): Parser for <input type=date>. (WebCore::ISODateTime::parseWeek): Parser for <input type=week>. (WebCore::ISODateTime::parseTime): Parser for <input type=time>. (WebCore::ISODateTime::parseDateTimeLocal): Parser for <input type=datetime-local>. (WebCore::ISODateTime::parseDateTime): Parser for <input type=datetime>.
  • html/ISODateTime.h: Added. Declare WebCore::ISODateTime class. (WebCore::ISODateTime::ISODateTime): (WebCore::ISODateTime::millisecond): (WebCore::ISODateTime::second): (WebCore::ISODateTime::minute): (WebCore::ISODateTime::hour): (WebCore::ISODateTime::monthDay): (WebCore::ISODateTime::month): (WebCore::ISODateTime::fullYear): (WebCore::ISODateTime::week):
Location:
trunk/WebCore
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51062 r51063  
     12009-11-16  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Introduce WebCore::ISODateTime class.
     6        https://bugs.webkit.org/show_bug.cgi?id=31340
     7
     8        This class represents a value of date/time types of the HTML5 INPUT
     9        element, and has some parsing methods for ISO 8601.
     10
     11        This change has no tests because the class is not used yet.
     12
     13        * GNUmakefile.am: Add ISODateTime.cpp and ISODateTime.h.
     14        * WebCore.gypi: ditto.
     15        * WebCore.pro: ditto.
     16        * WebCore.vcproj/WebCore.vcproj: ditto.
     17        * WebCore.xcodeproj/project.pbxproj: ditto.
     18        * WebCoreSources.bkl: ditto.
     19        * html/ISODateTime.cpp: Added. Implementation of WebCore::ISODateTime class.
     20        (WebCore::isLeapYear):
     21        (WebCore::maxDayOfMonth):
     22        (WebCore::dayOfWeek):
     23        (WebCore::ISODateTime::maxWeekNumberInYear):
     24        (WebCore::countDigits):
     25        (WebCore::toInt):
     26        (WebCore::ISODateTime::parseYear): Private helper for parseDate() and parseWeek().
     27        (WebCore::ISODateTime::addDay): Private helper for parseTimeZone().
     28        (WebCore::ISODateTime::addMinute): ditto.
     29        (WebCore::ISODateTime::parseTimeZone): Private helper for parseDateTime().
     30        (WebCore::ISODateTime::parseMonth): Parser for <input type=month>.
     31        (WebCore::ISODateTime::parseDate): Parser for <input type=date>.
     32        (WebCore::ISODateTime::parseWeek): Parser for <input type=week>.
     33        (WebCore::ISODateTime::parseTime): Parser for <input type=time>.
     34        (WebCore::ISODateTime::parseDateTimeLocal): Parser for <input type=datetime-local>.
     35        (WebCore::ISODateTime::parseDateTime): Parser for <input type=datetime>.
     36        * html/ISODateTime.h: Added.  Declare WebCore::ISODateTime class.
     37        (WebCore::ISODateTime::ISODateTime):
     38        (WebCore::ISODateTime::millisecond):
     39        (WebCore::ISODateTime::second):
     40        (WebCore::ISODateTime::minute):
     41        (WebCore::ISODateTime::hour):
     42        (WebCore::ISODateTime::monthDay):
     43        (WebCore::ISODateTime::month):
     44        (WebCore::ISODateTime::fullYear):
     45        (WebCore::ISODateTime::week):
     46
    1472009-11-16  Alexey Proskuryakov  <ap@apple.com>
    248
  • trunk/WebCore/GNUmakefile.am

    r50977 r51063  
    11301130        WebCore/html/HTMLViewSourceDocument.cpp \
    11311131        WebCore/html/HTMLViewSourceDocument.h \
     1132        WebCore/html/ISODateTime.cpp \
     1133        WebCore/html/ISODateTime.h \
    11321134        WebCore/html/ImageData.cpp \
    11331135        WebCore/html/ImageData.h \
  • trunk/WebCore/WebCore.gypi

    r50980 r51063  
    15041504            'html/HTMLViewSourceDocument.cpp',
    15051505            'html/HTMLViewSourceDocument.h',
     1506            'html/ISODateTime.cpp',
     1507            'html/ISODateTime.h',
    15061508            'html/ImageData.cpp',
    15071509            'html/ImageData.h',
  • trunk/WebCore/WebCore.pro

    r50970 r51063  
    10721072    html/HTMLUListElement.cpp \
    10731073    html/HTMLViewSourceDocument.cpp \
     1074    html/ISODateTime.cpp \
    10741075    html/ImageData.cpp \
    10751076    html/PreloadScanner.cpp \
     
    17521753    html/HTMLVideoElement.h \
    17531754    html/HTMLViewSourceDocument.h \
     1755    html/ISODateTime.h \
    17541756    html/ImageData.h \
    17551757    html/PreloadScanner.h \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r50980 r51063  
    3379633796                        </File>
    3379733797                        <File
     33798                                RelativePath="..\html\ISODateParser.cpp"
     33799                                >
     33800                        </File>
     33801                        <File
     33802                                RelativePath="..\html\ISODateParser.h"
     33803                                >
     33804                        </File>
     33805                        <File
    3379833806                                RelativePath="..\html\ImageData.cpp"
    3379933807                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r50998 r51063  
    47404740                F5C041E60FFCA96D00839D4A /* JSHTMLDataListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5C041E10FFCA96D00839D4A /* JSHTMLDataListElement.cpp */; };
    47414741                F5C041E70FFCA96D00839D4A /* JSHTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041E20FFCA96D00839D4A /* JSHTMLDataListElement.h */; };
     4742                F5D3A57C106B83B300545297 /* ISODateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D3A57A106B83B300545297 /* ISODateTime.cpp */; };
     4743                F5D3A57D106B83B300545297 /* ISODateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = F5D3A57B106B83B300545297 /* ISODateTime.h */; settings = {ATTRIBUTES = (Private, ); }; };
    47424744                F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; };
    47434745                F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };
     
    99509952                F5C2869402846DCD018635CA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
    99519953                F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
     9954                F5D3A57A106B83B300545297 /* ISODateTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ISODateTime.cpp; sourceTree = "<group>"; };
     9955                F5D3A57B106B83B300545297 /* ISODateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISODateTime.h; sourceTree = "<group>"; };
    99529956                F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
    99539957                F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; };
     
    1273712741                                BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */,
    1273812742                                BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */,
     12743                                F5D3A57A106B83B300545297 /* ISODateTime.cpp */,
     12744                                F5D3A57B106B83B300545297 /* ISODateTime.h */,
    1273912745                                A77979130D6B9D0C003851B9 /* ImageData.cpp */,
    1274012746                                A77979140D6B9D0C003851B9 /* ImageData.h */,
     
    1690116907                                514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */,
    1690216908                                514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */,
     16909                                F5D3A57D106B83B300545297 /* ISODateTime.h in Headers */,
    1690316910                                B275356E0B053814002CE64F /* Icon.h in Headers */,
    1690416911                                5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */,
     
    1904619053                                0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
    1904719054                                514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
     19055                                F5D3A57C106B83B300545297 /* ISODateTime.cpp in Sources */,
    1904819056                                5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */,
    1904919057                                445C8DB710015FC90031531A /* IconDatabaseNone.cpp in Sources */,
  • trunk/WebCore/WebCoreSources.bkl

    r50968 r51063  
    675675        html/HTMLUListElement.cpp
    676676        html/HTMLViewSourceDocument.cpp
     677        html/ISODateTime.cpp
    677678        html/ImageData.cpp
    678679        html/PreloadScanner.cpp
Note: See TracChangeset for help on using the changeset viewer.