Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (129972 => 129973)
--- trunk/Source/WebCore/CMakeLists.txt 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/CMakeLists.txt 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1994,7 +1994,6 @@
platform/text/LineEnding.cpp
platform/text/LocaleNone.cpp
platform/text/LocaleToScriptMappingDefault.cpp
- platform/text/LocalizedDateNone.cpp
platform/text/Localizer.cpp
platform/text/QuotedPrintable.cpp
platform/text/RegularExpression.cpp
Modified: trunk/Source/WebCore/ChangeLog (129972 => 129973)
--- trunk/Source/WebCore/ChangeLog 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/ChangeLog 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1,3 +1,41 @@
+2012-09-29 Kent Tamura <[email protected]>
+
+ Remove LocalizedDate*.*
+ https://bugs.webkit.org/show_bug.cgi?id=97957
+
+ Reviewed by Kentaro Hara.
+
+ The functions declared in LocalizedDate.h are replaced with member
+ functions of Localizer. LocalizedDate.h and its implementations
+ are not needed any more.
+
+ No new tests. This should not change any behavior.
+
+ * GNUmakefile.list.am: Remove LocalizedDate.h and LocalizedDateNode.cpp
+ * WebCore.vcproj/WebCore.vcproj: ditto.
+ * WebCore.xcodeproj/project.pbxproj: ditto.
+ * CMakeLists.txt: Remove LocalizedDateNone.cpp
+ * Target.pri: ditto.
+ * WebCore.gyp/WebCore.gyp: Remove LocalizedDate*.*. Update a comment.
+ * WebCore.gypi: Remove LocalizedDate*.*.
+
+ * html/BaseDateAndTimeInputType.cpp: Use Localizer functions.
+ (WebCore::BaseDateAndTimeInputType::localizeValue):
+ (WebCore::BaseDateAndTimeInputType::convertFromVisibleValue):
+ * html/DateInputType.cpp: ditto.
+ (WebCore::DateInputType::fixedPlaceholder):
+
+ * platform/text/Localizer.h:
+ (Localizer): Move comments from LocalziedDate.h.
+ * platform/text/mac/LocaleMac.mm:
+ Remove unnecessary include of LocalizedDate.h.
+
+ * platform/text/LocalizedDate.h: Removed.
+ * platform/text/LocalizedDateICU.cpp: Removed.
+ * platform/text/LocalizedDateNone.cpp: Removed.
+ * platform/text/LocalizedDateWin.cpp: Removed.
+ * platform/text/mac/LocalizedDateMac.cpp: Removed.
+
2012-09-28 Adam Barth <[email protected]>
[V8] The concept of forceNewObject is unneeded (dom-traverse gets 3% faster)
Modified: trunk/Source/WebCore/GNUmakefile.list.am (129972 => 129973)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-09-29 08:49:57 UTC (rev 129973)
@@ -4782,8 +4782,6 @@
Source/WebCore/platform/text/LocaleNone.cpp \
Source/WebCore/platform/text/LocaleToScriptMapping.h \
Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp \
- Source/WebCore/platform/text/LocalizedDate.h \
- Source/WebCore/platform/text/LocalizedDateNone.cpp \
Source/WebCore/platform/text/Localizer.cpp \
Source/WebCore/platform/text/Localizer.h \
Source/WebCore/platform/text/ParserUtilities.h \
Modified: trunk/Source/WebCore/Target.pri (129972 => 129973)
--- trunk/Source/WebCore/Target.pri 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/Target.pri 2012-09-29 08:49:57 UTC (rev 129973)
@@ -920,7 +920,6 @@
platform/text/Hyphenation.cpp \
platform/text/LocaleNone.cpp \
platform/text/LocaleToScriptMappingDefault.cpp \
- platform/text/LocalizedDateNone.cpp \
platform/text/Localizer.cpp \
platform/text/QuotedPrintable.cpp \
platform/CalculationValue.cpp \
Modified: trunk/Source/WebCore/WebCore.gyp/WebCore.gyp (129972 => 129973)
--- trunk/Source/WebCore/WebCore.gyp/WebCore.gyp 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/WebCore.gyp/WebCore.gyp 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1647,7 +1647,6 @@
['exclude', 'platform/network/ResourceHandle\\.cpp$'],
['exclude', 'platform/sql/SQLiteFileSystem\\.cpp$'],
['exclude', 'platform/text/LocaleToScriptMappingICU\\.cpp$'],
- ['exclude', 'platform/text/LocalizedDateNone\\.cpp$'],
['exclude', 'platform/text/TextEncodingDetectorNone\\.cpp$'],
],
'conditions': [
@@ -1776,13 +1775,11 @@
['include', 'WebKit/mac/WebCoreSupport/WebSystemInterface\\.mm$'],
- # We use LocalizedDateMac.cpp with LocaleMac.mm instead of
- # LocalizedDateICU.cpp in order to apply system locales.
+ # We use LocaleMac.mm instead of LocaleICU.cpp in order to
+ # apply system locales.
['exclude', 'platform/text/LocaleICU\\.cpp$'],
['exclude', 'platform/text/LocaleICU\\.h$'],
- ['exclude', 'platform/text/LocalizedDateICU\\.cpp$'],
['include', 'platform/text/mac/LocaleMac\\.mm$'],
- ['include', 'platform/text/mac/LocalizedDateMac\\.cpp$'],
# The Mac uses platform/mac/KillRingMac.mm instead of the dummy
# implementation.
@@ -1859,8 +1856,6 @@
['exclude', 'platform/text/LocaleICU\\.cpp$'],
['exclude', 'platform/text/LocaleICU\\.h$'],
- ['exclude', 'platform/text/LocalizedDateICU\.cpp$'],
- ['include', 'platform/text/LocalizedDateWin\.cpp$'],
['include', 'platform/text/LocaleWin\.cpp$'],
['include', 'platform/text/LocaleWin\.h$'],
],
Modified: trunk/Source/WebCore/WebCore.gypi (129972 => 129973)
--- trunk/Source/WebCore/WebCore.gypi 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/WebCore.gypi 2012-09-29 08:49:57 UTC (rev 129973)
@@ -5674,10 +5674,6 @@
'platform/text/LocaleToScriptMappingICU.cpp',
'platform/text/LocaleWin.cpp',
'platform/text/LocaleWin.h',
- 'platform/text/LocalizedDate.h',
- 'platform/text/LocalizedDateICU.cpp',
- 'platform/text/LocalizedDateNone.cpp',
- 'platform/text/LocalizedDateWin.cpp',
'platform/text/Localizer.cpp',
'platform/text/Localizer.h',
'platform/text/ParserUtilities.h',
@@ -5718,7 +5714,6 @@
'platform/text/mac/HyphenationMac.mm',
'platform/text/mac/LocaleMac.h',
'platform/text/mac/LocaleMac.mm',
- 'platform/text/mac/LocalizedDateMac.cpp',
'platform/text/mac/StringImplMac.mm',
'platform/text/mac/StringMac.mm',
'platform/text/mac/TextBoundaries.mm',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (129972 => 129973)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-09-29 08:49:57 UTC (rev 129973)
@@ -33718,14 +33718,6 @@
>
</File>
<File
- RelativePath="..\platform\text\LocalizedDate.h"
- >
- </File>
- <File
- RelativePath="..\platform\text\LocalizedDateNone.cpp"
- >
- </File>
- <File
RelativePath="..\platform\text\Localizer.cpp"
>
</File>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (129972 => 129973)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-09-29 08:49:57 UTC (rev 129973)
@@ -3789,8 +3789,6 @@
A54A82F115228DF600C72BA6 /* DOMNodePrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
A5732B0A136A161D005C8D7C /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B08136A161D005C8D7C /* DateComponents.cpp */; };
A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; };
- A5732B0D136A16C4005C8D7C /* LocalizedDate.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B0C136A16C4005C8D7C /* LocalizedDate.h */; };
- A5732B0F136A1715005C8D7C /* LocalizedDateNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B0E136A1715005C8D7C /* LocalizedDateNone.cpp */; };
A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */; };
A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -11002,8 +11000,6 @@
A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMNodePrivate.h; sourceTree = "<group>"; };
A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
A5732B09136A161D005C8D7C /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
- A5732B0C136A16C4005C8D7C /* LocalizedDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedDate.h; sourceTree = "<group>"; };
- A5732B0E136A1715005C8D7C /* LocalizedDateNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalizedDateNone.cpp; sourceTree = "<group>"; };
A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreakIteratorPoolICU.h; sourceTree = "<group>"; };
A5AFB34D115151A700B045CB /* StepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StepRange.cpp; sourceTree = "<group>"; };
A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = "<group>"; };
@@ -19940,8 +19936,6 @@
89B5EAA011E8003D00F2367E /* LineEnding.h */,
7633A72413D8B33A008501B6 /* LocaleToScriptMapping.h */,
7633A72513D8B33A008501B6 /* LocaleToScriptMappingDefault.cpp */,
- A5732B0C136A16C4005C8D7C /* LocalizedDate.h */,
- A5732B0E136A1715005C8D7C /* LocalizedDateNone.cpp */,
F544F78615CFB2A800AF33A8 /* Localizer.cpp */,
F544F78715CFB2A800AF33A8 /* Localizer.h */,
BC76AC110DD7AD5C00415F34 /* ParserUtilities.h */,
@@ -24317,7 +24311,6 @@
F5973DE015CFB2030027F804 /* LocaleMac.h in Headers */,
7633A72613D8B33A008501B6 /* LocaleToScriptMapping.h in Headers */,
89878568122CA064003AABDA /* LocalFileSystem.h in Headers */,
- A5732B0D136A16C4005C8D7C /* LocalizedDate.h in Headers */,
935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */,
F544F78915CFB2A800AF33A8 /* Localizer.h in Headers */,
BCE1C41B0D982980003B02F2 /* Location.h in Headers */,
@@ -27619,7 +27612,6 @@
F5973DE115CFB2030027F804 /* LocaleMac.mm in Sources */,
7633A72713D8B33A008501B6 /* LocaleToScriptMappingDefault.cpp in Sources */,
89878567122CA064003AABDA /* LocalFileSystem.cpp in Sources */,
- A5732B0F136A1715005C8D7C /* LocalizedDateNone.cpp in Sources */,
C046E1AC1208A9FE00BA2CF7 /* LocalizedStrings.cpp in Sources */,
BC25B52A131C6D3900180E10 /* LocalizedStringsMac.cpp in Sources */,
F544F78815CFB2A800AF33A8 /* Localizer.cpp in Sources */,
Modified: trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp (129972 => 129973)
--- trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp 2012-09-29 08:49:57 UTC (rev 129973)
@@ -34,7 +34,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "KeyboardEvent.h"
-#include "LocalizedDate.h"
+#include "Localizer.h"
#include <limits>
#include <wtf/CurrentTime.h>
#include <wtf/DateMath.h>
@@ -156,7 +156,7 @@
if (!parseToDateComponents(proposedValue, &date))
return proposedValue;
- String localized = formatLocalizedDate(date);
+ String localized = element()->localizer().formatDateTime(date);
return localized.isEmpty() ? proposedValue : localized;
}
@@ -170,7 +170,7 @@
if (visibleValue.isEmpty())
return visibleValue;
- double parsedValue = parseLocalizedDate(visibleValue, dateType());
+ double parsedValue = element()->localizer().parseDateTime(visibleValue, dateType());
if (!isfinite(parsedValue))
return visibleValue;
Modified: trunk/Source/WebCore/html/DateInputType.cpp (129972 => 129973)
--- trunk/Source/WebCore/html/DateInputType.cpp 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/html/DateInputType.cpp 2012-09-29 08:49:57 UTC (rev 129973)
@@ -37,7 +37,7 @@
#include "HTMLNames.h"
#include "InputTypeNames.h"
#include "KeyboardEvent.h"
-#include "LocalizedDate.h"
+#include "Localizer.h"
#include <wtf/PassOwnPtr.h>
#if ENABLE(INPUT_TYPE_DATE)
@@ -164,7 +164,7 @@
String DateInputType::fixedPlaceholder()
{
- return localizedDateFormatText();
+ return element()->localizer().dateFormatText();
}
#endif // ENABLE(CALENDAR_PICKER)
Deleted: trunk/Source/WebCore/platform/text/LocalizedDate.h (129972 => 129973)
--- trunk/Source/WebCore/platform/text/LocalizedDate.h 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/platform/text/LocalizedDate.h 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LocalizedDate_h
-#define LocalizedDate_h
-
-#include "DateComponents.h"
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-// Parses a string representation of a date string localized
-// for the browser's current locale for a particular date type.
-// If the input string is not valid or an implementation doesn't
-// support localized dates, this function returns NaN. If the
-// input string is valid this function returns the number
-// of milliseconds since 1970-01-01 00:00:00.000 UTC.
-double parseLocalizedDate(const String&, DateComponents::Type);
-
-// Serializes the specified date into a formatted date string
-// to display to the user. If an implementation doesn't support
-// localized dates the function should return an empty string.
-String formatLocalizedDate(const DateComponents& dateComponents);
-
-#if ENABLE(CALENDAR_PICKER)
-String localizedDateFormatText();
-#endif
-
-} // namespace WebCore
-
-#endif // LocalizedDate_h
Deleted: trunk/Source/WebCore/platform/text/LocalizedDateICU.cpp (129972 => 129973)
--- trunk/Source/WebCore/platform/text/LocalizedDateICU.cpp 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/platform/text/LocalizedDateICU.cpp 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LocalizedDate.h"
-
-#include "LocaleICU.h"
-#include <limits>
-
-using namespace std;
-
-namespace WebCore {
-
-double parseLocalizedDate(const String& input, DateComponents::Type type)
-{
- return LocaleICU::currentLocale()->parseDateTime(input, type);
-}
-
-String formatLocalizedDate(const DateComponents& dateComponents)
-{
- return LocaleICU::currentLocale()->formatDateTime(dateComponents);
-}
-
-#if ENABLE(CALENDAR_PICKER)
-String localizedDateFormatText()
-{
- return LocaleICU::currentLocale()->dateFormatText();
-}
-#endif
-
-}
Deleted: trunk/Source/WebCore/platform/text/LocalizedDateNone.cpp (129972 => 129973)
--- trunk/Source/WebCore/platform/text/LocalizedDateNone.cpp 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/platform/text/LocalizedDateNone.cpp 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LocalizedDate.h"
-
-#include <limits>
-
-using namespace std;
-
-namespace WebCore {
-
-double parseLocalizedDate(const String&, DateComponents::Type)
-{
- return numeric_limits<double>::quiet_NaN();
-}
-
-String formatLocalizedDate(const DateComponents&)
-{
- return String();
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/platform/text/LocalizedDateWin.cpp (129972 => 129973)
--- trunk/Source/WebCore/platform/text/LocalizedDateWin.cpp 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/platform/text/LocalizedDateWin.cpp 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LocalizedDate.h"
-
-#include "LocaleWin.h"
-#include <limits>
-
-using namespace std;
-
-namespace WebCore {
-
-double parseLocalizedDate(const String& input, DateComponents::Type type)
-{
- return LocaleWin::currentLocale()->parseDateTime(input, type);
-}
-
-String formatLocalizedDate(const DateComponents& dateComponents)
-{
- return LocaleWin::currentLocale()->formatDateTime(dateComponents);
-}
-
-#if ENABLE(CALENDAR_PICKER)
-String localizedDateFormatText()
-{
- return LocaleWin::currentLocale()->dateFormatText();
-}
-#endif
-
-}
Modified: trunk/Source/WebCore/platform/text/Localizer.h (129972 => 129973)
--- trunk/Source/WebCore/platform/text/Localizer.h 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/platform/text/Localizer.h 2012-09-29 08:49:57 UTC (rev 129973)
@@ -88,7 +88,17 @@
virtual String dateFormatText() = 0;
#endif
+ // Parses a string representation of a date/time string localized
+ // for this Localizer locale. If the input string is not valid or
+ // an implementation doesn't support localized dates, this
+ // function returns NaN. If the input string is valid this
+ // function returns the number of milliseconds since 1970-01-01
+ // 00:00:00.000 UTC.
virtual double parseDateTime(const String&, DateComponents::Type) = 0;
+
+ // Serializes the specified date into a formatted date string to
+ // display to the user. If an implementation doesn't support
+ // localized dates the function should return an empty string.
virtual String formatDateTime(const DateComponents&) = 0;
virtual ~Localizer();
Modified: trunk/Source/WebCore/platform/text/mac/LocaleMac.mm (129972 => 129973)
--- trunk/Source/WebCore/platform/text/mac/LocaleMac.mm 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/platform/text/mac/LocaleMac.mm 2012-09-29 08:49:57 UTC (rev 129973)
@@ -34,7 +34,6 @@
#import <Foundation/NSDateFormatter.h>
#import <Foundation/NSLocale.h>
#include "Language.h"
-#include "LocalizedDate.h"
#include "LocalizedStrings.h"
#include <wtf/DateMath.h>
#include <wtf/PassOwnPtr.h>
Deleted: trunk/Source/WebCore/platform/text/mac/LocalizedDateMac.cpp (129972 => 129973)
--- trunk/Source/WebCore/platform/text/mac/LocalizedDateMac.cpp 2012-09-29 06:31:08 UTC (rev 129972)
+++ trunk/Source/WebCore/platform/text/mac/LocalizedDateMac.cpp 2012-09-29 08:49:57 UTC (rev 129973)
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LocalizedDate.h"
-
-#include "LocaleMac.h"
-#include <limits>
-
-using namespace std;
-
-namespace WebCore {
-
-double parseLocalizedDate(const String& input, DateComponents::Type type)
-{
- return LocaleMac::currentLocale()->parseDateTime(input, type);
-}
-
-String formatLocalizedDate(const DateComponents& dateComponents)
-{
- return LocaleMac::currentLocale()->formatDateTime(dateComponents);
-}
-
-#if ENABLE(CALENDAR_PICKER)
-String localizedDateFormatText()
-{
- return LocaleMac::currentLocale()->dateFormatText();
-}
-#endif
-
-}