Skip to content
  • yosin@chromium.org's avatar
    [Platform] Implement Date Time format parser · ba3d7a8c
    yosin@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=89963
    
    Reviewed by Kent Tamura.
    
    Source/WebCore:
    
    This patch introduces Unicode TR35 LDML date time format parser for
    input type "time" if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) is true.
    
    Test: WebKit/chromium/tests/DateTimeFormatTest.cpp
    
    * CMakeLists.txt: Added DateTimeFormat.cpp
    * GNUmakefile.list.am: Added DateTimeFormat.{cpp,h}
    * Target.pri: ditto
    * WebCore.gypi: ditto
    * WebCore.vcproj/WebCore.vcproj: ditto
    * WebCore.xcodeproj/product.pbxproj: ditto
    * platform/text/DateTimeFormat.cpp: Added.
    (WebCore::mapCharacterToFieldTypeInternal):
    (WebCore::DateTimeFormat::DateTimeFormat):
    (WebCore::DateTimeFormat::mapCharacterToFieldType):
    (WebCore::DateTimeFormat::parse):
    * platform/text/DateTimeFormat.h: Added.
    (DateTimeFormat):
    (TokenHandler):
    (WebCore::DateTimeFormat::TokenHandler::~TokenHandler):
    
    Source/WebKit/chromium:
    
    This patch adds an unit test for date time format parser if
    ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) is true.
    
    * tests/DateTimeFormatTest.cpp: Added.
    (DateTimeFormatTest):
    (Token):
    (DateTimeFormatTest::Token::Token):
    (DateTimeFormatTest::Token::operator==):
    (DateTimeFormatTest::Token::toString):
    (Tokens):
    (DateTimeFormatTest::Tokens::Tokens):
    (DateTimeFormatTest::Tokens::operator==):
    (DateTimeFormatTest::Tokens::toString):
    (DateTimeFormatTest::parse):
    (DateTimeFormatTest::single):
    (TokenHandler):
    (DateTimeFormatTest::TokenHandler::~TokenHandler):
    (DateTimeFormatTest::TokenHandler::fieldType):
    (DateTimeFormatTest::TokenHandler::tokens):
    (DateTimeFormatTest::TokenHandler::visitField):
    (DateTimeFormatTest::TokenHandler::visitLiteral):
    (operator<<):
    (TEST_F):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ba3d7a8c