Unreviewed, rolling out r225430.
authorjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2017 23:59:31 +0000 (23:59 +0000)
committerjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2017 23:59:31 +0000 (23:59 +0000)
This caused an API failure on release.

Reverted changeset:

"Move DateComponents into WTF"
https://bugs.webkit.org/show_bug.cgi?id=180211
https://trac.webkit.org/changeset/225430

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Document.cpp
Source/WebCore/html/BaseDateAndTimeInputType.h
Source/WebCore/html/DateTimeInputType.h
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/InputType.cpp
Source/WebCore/html/InputType.h
Source/WebCore/platform/DateComponents.cpp [moved from Source/WTF/wtf/DateComponents.cpp with 98% similarity]
Source/WebCore/platform/DateComponents.h [moved from Source/WTF/wtf/DateComponents.h with 84% similarity]
Source/WebCore/platform/text/PlatformLocale.h
Source/WebCore/platform/text/ios/LocalizedDateCache.h
Source/WebCore/platform/text/mac/LocaleMac.h
Source/WebCore/platform/text/win/LocaleWin.cpp
Source/WebCore/platform/text/win/LocaleWin.h
Source/WebCore/rendering/RenderThemeIOS.mm

index 11f0687..1226015 100644 (file)
@@ -1,3 +1,15 @@
+2017-12-05  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r225430.
+
+        This caused an API failure on release.
+
+        Reverted changeset:
+
+        "Move DateComponents into WTF"
+        https://bugs.webkit.org/show_bug.cgi?id=180211
+        https://trac.webkit.org/changeset/225430
+
 2017-12-05  Michael Saboff  <msaboff@apple.com>
 
         Make WebKit build for ARM64_32
index d0c9c73..de1d0f0 100644 (file)
@@ -85,7 +85,6 @@
                93F1993E19D7958D00C2390B /* StringView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F1993D19D7958D00C2390B /* StringView.cpp */; };
                9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; };
                A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */; };
-               A3CABA081FD095110007A4DE /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3CABA061FD095110007A4DE /* DateComponents.cpp */; };
                A3E4DD931F3A803400DED0B4 /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E4DD911F3A803400DED0B4 /* TextStream.cpp */; };
                A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; };
                A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplMac.mm */; };
                A30D412C1F0DE0BA00B71954 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };
                A30D412D1F0DE13F00B71954 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };
                A3AB6E6A1F3E1AD6009C14B1 /* ValueToString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueToString.h; sourceTree = "<group>"; };
-               A3CABA061FD095110007A4DE /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
-               A3CABA071FD095110007A4DE /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
                A3E4DD911F3A803400DED0B4 /* TextStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextStream.cpp; sourceTree = "<group>"; };
                A3E4DD921F3A803400DED0B4 /* TextStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextStream.h; sourceTree = "<group>"; };
                A5098AFF1C169E0700087797 /* SandboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxSPI.h; sourceTree = "<group>"; };
                                A8A47276151A825A004123FF /* CurrentTime.h */,
                                A8A47277151A825A004123FF /* DataLog.cpp */,
                                A8A47278151A825A004123FF /* DataLog.h */,
-                               A3CABA061FD095110007A4DE /* DateComponents.cpp */,
-                               A3CABA071FD095110007A4DE /* DateComponents.h */,
                                A8A47279151A825A004123FF /* DateMath.cpp */,
                                A8A4727A151A825A004123FF /* DateMath.h */,
                                996B17841EBA441C007E10EB /* DebugUtilities.h */,
                                A8A47439151A825B004123FF /* CString.cpp in Sources */,
                                A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */,
                                A8A4739E151A825B004123FF /* DataLog.cpp in Sources */,
-                               A3CABA081FD095110007A4DE /* DateComponents.cpp in Sources */,
                                A8A473A0151A825B004123FF /* DateMath.cpp in Sources */,
                                A8A473A2151A825B004123FF /* DecimalNumber.cpp in Sources */,
                                1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */,
index 702cf2f..a8cd5f6 100644 (file)
@@ -232,7 +232,6 @@ set(WTF_SOURCES
     CryptographicallyRandomNumber.cpp
     CurrentTime.cpp
     DataLog.cpp
-    DateComponents.cpp
     DateMath.cpp
     DecimalNumber.cpp
     FastBitVector.cpp
index bd6c806..0a87a9e 100644 (file)
@@ -1,3 +1,15 @@
+2017-12-05  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r225430.
+
+        This caused an API failure on release.
+
+        Reverted changeset:
+
+        "Move DateComponents into WTF"
+        https://bugs.webkit.org/show_bug.cgi?id=180211
+        https://trac.webkit.org/changeset/225430
+
 2017-12-05  Simon Fraser  <simon.fraser@apple.com>
 
         Composited frames incorrectly get requestAnimationFrame throttled
index e41659b..5660860 100644 (file)
@@ -1394,6 +1394,7 @@ platform/ContentType.cpp
 platform/ContextMenu.cpp
 platform/ContextMenuItem.cpp
 platform/Cursor.cpp
+platform/DateComponents.cpp
 platform/Decimal.cpp
 platform/DragData.cpp
 platform/DragImage.cpp
index 16cef29..079f3d8 100644 (file)
                A54A0C6C1DB831F90017A90B /* WorkerInspectorProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A0C6A1DB831F20017A90B /* WorkerInspectorProxy.h */; };
                A554B5F31E38393A001D4E03 /* PerformanceUserTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A554B5F11E383936001D4E03 /* PerformanceUserTiming.h */; };
                A55639D11C6F09E300806D8E /* WorkerConsoleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */; };
+               A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A578F4351DE00EEB003DFC6A /* PromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F4331DE00ED6003DFC6A /* PromiseRejectionEvent.h */; };
                A578F43C1DE01423003DFC6A /* JSPromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F43A1DE013FB003DFC6A /* JSPromiseRejectionEvent.h */; };
                A578F43F1DE0B630003DFC6A /* RejectedPromiseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F43E1DE0B62B003DFC6A /* RejectedPromiseTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A554B5F11E383936001D4E03 /* PerformanceUserTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceUserTiming.h; sourceTree = "<group>"; };
                A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerConsoleClient.cpp; sourceTree = "<group>"; };
                A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerConsoleClient.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>"; };
                A578F4321DE00ED6003DFC6A /* PromiseRejectionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PromiseRejectionEvent.cpp; sourceTree = "<group>"; };
                A578F4331DE00ED6003DFC6A /* PromiseRejectionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromiseRejectionEvent.h; sourceTree = "<group>"; };
                A578F4341DE00ED6003DFC6A /* PromiseRejectionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PromiseRejectionEvent.idl; sourceTree = "<group>"; };
                                46C696C91E7205E400597937 /* CPUMonitor.h */,
                                E11AF15011B9A1A300805103 /* Cursor.cpp */,
                                F587868402DE3B8601EA4122 /* Cursor.h */,
+                               A5732B08136A161D005C8D7C /* DateComponents.cpp */,
+                               A5732B09136A161D005C8D7C /* DateComponents.h */,
                                37C738F11EDBDE87003F2B0B /* DateTimeChooser.h */,
                                37C738F21EDBDE87003F2B0B /* DateTimeChooserClient.h */,
                                45FEA5CD156DDE8C00654101 /* Decimal.cpp */,
                                81AC599A131636E60009A7E0 /* DataTransferItemList.h in Headers */,
                                E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
                                E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
+                               A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */,
                                F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */,
                                37C738F31EDBDE8A003F2B0B /* DateTimeChooser.h in Headers */,
                                37C738F41EDBDE8D003F2B0B /* DateTimeChooserClient.h in Headers */,
index cb8f3ec..f350dba 100644 (file)
@@ -53,6 +53,7 @@
 #include "CustomEvent.h"
 #include "DOMImplementation.h"
 #include "DOMWindow.h"
+#include "DateComponents.h"
 #include "DebugPageOverlays.h"
 #include "DocumentLoader.h"
 #include "DocumentMarkerController.h"
index b41e5f3..6e15f5d 100644 (file)
@@ -33,8 +33,8 @@
 
 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
 
+#include "DateComponents.h"
 #include "InputType.h"
-#include <wtf/DateComponents.h>
 
 namespace WebCore {
 
index e1e561a..c87ac7b 100644 (file)
@@ -39,8 +39,7 @@ namespace WebCore {
 
 class DateTimeInputType final : public BaseChooserOnlyDateAndTimeInputType {
 public:
-    explicit DateTimeInputType(HTMLInputElement& element)
-        : BaseChooserOnlyDateAndTimeInputType(element) { }
+    explicit DateTimeInputType(HTMLInputElement& element) : BaseDateTimeInputType(element) { }
 
 private:
     const AtomicString& formControlType() const override;
index 81bbdbb..4ec4946 100644 (file)
@@ -30,7 +30,7 @@
 #include <memory>
 
 #if PLATFORM(IOS)
-#include <wtf/DateComponents.h>
+#include "DateComponents.h"
 #endif
 
 namespace WebCore {
index 4048bff..1203eda 100644 (file)
@@ -34,6 +34,7 @@
 #include "CheckboxInputType.h"
 #include "ColorInputType.h"
 #include "DOMFormData.h"
+#include "DateComponents.h"
 #include "DateInputType.h"
 #include "DateTimeInputType.h"
 #include "DateTimeLocalInputType.h"
@@ -74,7 +75,6 @@
 #include "WeekInputType.h"
 #include <limits>
 #include <wtf/Assertions.h>
-#include <wtf/DateComponents.h>
 #include <wtf/HashMap.h>
 #include <wtf/text/StringHash.h>
 #include <wtf/text/TextBreakIterator.h>
index 695ecbb..c739a8f 100644 (file)
 #include "HTMLTextFormControlElement.h"
 #include "RenderPtr.h"
 #include "StepRange.h"
-#include <wtf/DateComponents.h>
 #include <wtf/FastMalloc.h>
 #include <wtf/Forward.h>
 #include <wtf/RefPtr.h>
 
+#if PLATFORM(IOS)
+#include "DateComponents.h"
+#endif
+
 namespace WebCore {
 
 class BeforeTextInsertedEvent;
 class Chrome;
 class DOMFormData;
+class DateComponents;
 class DragData;
 class Event;
 class FileList;
similarity index 98%
rename from Source/WTF/wtf/DateComponents.cpp
rename to Source/WebCore/platform/DateComponents.cpp
index 8213d09..db70788 100644 (file)
@@ -37,7 +37,7 @@
 #include <wtf/MathExtras.h>
 #include <wtf/text/WTFString.h>
 
-namespace WTF {
+namespace WebCore {
 
 // HTML5 specification defines minimum week of year is one.
 const int DateComponents::minimumWeekNumber = 1;
@@ -51,6 +51,17 @@ static const int maximumWeekInMaximumYear = 37; // The week of 275760-09-13
 
 static const int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
+static bool isLeapYear(int year)
+{
+    if (year % 4)
+        return false;
+    if (!(year % 400))
+        return true;
+    if (!(year % 100))
+        return false;
+    return true;
+}
+
 // 'month' is 0-based.
 static int maxDayOfMonth(int year, int month)
 {
@@ -184,8 +195,7 @@ bool DateComponents::addDay(int dayDiff)
             if (day > maxDay) {
                 day = 1;
                 ++month;
-                // month is 0-origin.
-                if (month >= 12) {
+                if (month >= 12) { // month is 0-origin.
                     month = 0;
                     ++year;
                 }
@@ -715,4 +725,4 @@ String DateComponents::toString(SecondFormat format) const
     return String("(Invalid DateComponents)");
 }
 
-} // namespace WTF
+} // namespace WebCore
similarity index 84%
rename from Source/WTF/wtf/DateComponents.h
rename to Source/WebCore/platform/DateComponents.h
index e026c47..04ade2c 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef DateComponents_h
+#define DateComponents_h
 
 #include <limits>
 #include <unicode/utypes.h>
 #include <wtf/Forward.h>
 
-namespace WTF {
+namespace WebCore {
 
 // A DateComponents instance represents one of the following date and time combinations:
 // * Month type: year-month
@@ -85,7 +86,7 @@ public:
 
     // Returns an ISO 8601 representation for this instance.
     // The format argument is valid for DateTime, DateTimeLocal, and Time types.
-    WTF_EXPORT_PRIVATE String toString(SecondFormat = None) const;
+    String toString(SecondFormat format = None) const;
 
     // parse*() and setMillisecondsSince*() functions are initializers for an
     // DateComponents instance. If these functions return false, the instance
@@ -101,17 +102,17 @@ public:
     // failures, and the trailing extra characters don't cause parse failures.
 
     // Sets year and month.
-    WTF_EXPORT_PRIVATE bool parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end);
+    bool parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end);
     // Sets year, month and monthDay.
-    WTF_EXPORT_PRIVATE bool parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end);
+    bool parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end);
     // Sets year and week.
-    WTF_EXPORT_PRIVATE bool parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end);
+    bool parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end);
     // Sets hour, minute, second and millisecond.
-    WTF_EXPORT_PRIVATE bool parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
+    bool parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
     // Sets year, month, monthDay, hour, minute, second and millisecond.
-    WTF_EXPORT_PRIVATE bool parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end);
+    bool parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end);
     // Sets year, month, monthDay, hour, minute, second and millisecond, and adjusts timezone.
-    WTF_EXPORT_PRIVATE bool parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
+    bool parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
 
     // The following setMillisecondsSinceEpochFor*() functions take
     // the number of milliseconds since 1970-01-01 00:00:00.000 UTC as
@@ -120,29 +121,29 @@ public:
     // false if they fail.
 
     // For Date type. Updates m_year, m_month and m_monthDay.
-    WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForDate(double);
+    bool setMillisecondsSinceEpochForDate(double ms);
     // For DateTime type. Updates m_year, m_month, m_monthDay, m_hour, m_minute, m_second and m_millisecond.
-    WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForDateTime(double);
+    bool setMillisecondsSinceEpochForDateTime(double ms);
     // For DateTimeLocal type. Updates m_year, m_month, m_monthDay, m_hour, m_minute, m_second and m_millisecond.
-    WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForDateTimeLocal(double);
+    bool setMillisecondsSinceEpochForDateTimeLocal(double ms);
     // For Month type. Updates m_year and m_month.
-    WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForMonth(double);
+    bool setMillisecondsSinceEpochForMonth(double ms);
     // For Week type. Updates m_year and m_week.
-    WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForWeek(double);
+    bool setMillisecondsSinceEpochForWeek(double ms);
 
     // For Time type. Updates m_hour, m_minute, m_second and m_millisecond.
-    WTF_EXPORT_PRIVATE bool setMillisecondsSinceMidnight(double);
+    bool setMillisecondsSinceMidnight(double ms);
 
     // Another initializer for Month type. Updates m_year and m_month.
-    WTF_EXPORT_PRIVATE bool setMonthsSinceEpoch(double);
+    bool setMonthsSinceEpoch(double months);
 
     // Returns the number of milliseconds from 1970-01-01 00:00:00 UTC.
     // For a DateComponents initialized with parseDateTimeLocal(),
     // millisecondsSinceEpoch() returns a value for UTC timezone.
-    WTF_EXPORT_PRIVATE double millisecondsSinceEpoch() const;
+    double millisecondsSinceEpoch() const;
     // Returns the number of months from 1970-01.
     // Do not call this for types other than Month.
-    WTF_EXPORT_PRIVATE double monthsSinceEpoch() const;
+    double monthsSinceEpoch() const;
     static inline double invalidMilliseconds() { return std::numeric_limits<double>::quiet_NaN(); }
 
     // Minimum and maxmimum limits for setMillisecondsSince*(),
@@ -178,8 +179,8 @@ private:
     // Helper for millisecondsSinceEpoch().
     double millisecondsSinceEpochForTime() const;
     // Helpers for setMillisecondsSinceEpochFor*().
-    bool setMillisecondsSinceEpochForDateInternal(double);
-    void setMillisecondsSinceMidnightInternal(double);
+    bool setMillisecondsSinceEpochForDateInternal(double ms);
+    void setMillisecondsSinceMidnightInternal(double ms);
     // Helper for toString().
     String toStringForTime(SecondFormat) const;
 
@@ -207,6 +208,6 @@ private:
 };
 
 
-} // namespace WTF
+} // namespace WebCore
 
-using WTF::DateComponents;
+#endif // DateComponents_h
index 5ed909a..a91fe83 100644 (file)
  * DAMAGE.
  */
 
-#pragma once
+#ifndef PlatformLocale_h
+#define PlatformLocale_h
 
-#include <wtf/DateComponents.h>
+#include "DateComponents.h"
 #include <wtf/Language.h>
 #include <wtf/text/WTFString.h>
 
@@ -154,3 +155,4 @@ inline std::unique_ptr<Locale> Locale::createDefault()
 }
 
 }
+#endif
index 2090dab..ca3ba1f 100644 (file)
@@ -28,8 +28,8 @@
 // FIXME: Rename this file to LocalizedDataCacheIOS.h and remove this guard.
 #if PLATFORM(IOS)
 
+#include "DateComponents.h"
 #include "FontCascade.h"
-#include <wtf/DateComponents.h>
 #include <wtf/HashMap.h>
 #include <wtf/RetainPtr.h>
 
index b112dab..6f4c9e2 100644 (file)
@@ -28,7 +28,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef LocaleMac_h
+#define LocaleMac_h
 
 #include "PlatformLocale.h"
 #include <wtf/Forward.h>
@@ -40,12 +41,10 @@ OBJC_CLASS NSCalendar;
 OBJC_CLASS NSDateFormatter;
 OBJC_CLASS NSLocale;
 
-namespace WTF {
-class DateComponents;
-}
-
 namespace WebCore {
 
+class DateComponents;
+
 class LocaleMac : public Locale {
 public:
     explicit LocaleMac(NSLocale*);
@@ -99,3 +98,4 @@ private:
 };
 
 } // namespace WebCore
+#endif
index bebcce3..d19693a 100644 (file)
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "LocaleWin.h"
 
+#include "DateComponents.h"
 #include "DateTimeFormat.h"
 #include "LocalizedStrings.h"
 #include <limits>
index 5840fab..0fed3bb 100644 (file)
@@ -28,7 +28,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef LocaleWin_h
+#define LocaleWin_h
 
 #include "PlatformLocale.h"
 #include <windows.h>
@@ -38,6 +39,7 @@
 
 namespace WebCore {
 
+class DateComponents;
 struct DateFormatToken;
 
 class LocaleWin : public Locale {
@@ -86,3 +88,4 @@ private:
 };
 
 } // namespace WebCore
+#endif
index eaf4de4..d2e641e 100644 (file)
@@ -32,6 +32,7 @@
 #import "CSSPrimitiveValue.h"
 #import "CSSToLengthConversionData.h"
 #import "CSSValueKeywords.h"
+#import "DateComponents.h"
 #import "Document.h"
 #import "File.h"
 #import "FloatRoundedRect.h"
@@ -69,7 +70,6 @@
 #import <objc/runtime.h>
 #import <pal/spi/cocoa/CoreTextSPI.h>
 #import <pal/spi/ios/UIKitSPI.h>
-#import <wtf/DateComponents.h>
 #import <wtf/NeverDestroyed.h>
 #import <wtf/RefPtr.h>
 #import <wtf/SoftLinking.h>