Changeset 225555 in webkit
- Timestamp:
- Dec 5, 2017 3:59:31 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r225552 r225555 1 2017-12-05 Matt Lewis <jlewis3@apple.com> 2 3 Unreviewed, rolling out r225430. 4 5 This caused an API failure on release. 6 7 Reverted changeset: 8 9 "Move DateComponents into WTF" 10 https://bugs.webkit.org/show_bug.cgi?id=180211 11 https://trac.webkit.org/changeset/225430 12 1 13 2017-12-05 Michael Saboff <msaboff@apple.com> 2 14 -
trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
r225524 r225555 86 86 9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; }; 87 87 A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */; }; 88 A3CABA081FD095110007A4DE /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3CABA061FD095110007A4DE /* DateComponents.cpp */; };89 88 A3E4DD931F3A803400DED0B4 /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E4DD911F3A803400DED0B4 /* TextStream.cpp */; }; 90 89 A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; }; … … 401 400 A30D412D1F0DE13F00B71954 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; }; 402 401 A3AB6E6A1F3E1AD6009C14B1 /* ValueToString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueToString.h; sourceTree = "<group>"; }; 403 A3CABA061FD095110007A4DE /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };404 A3CABA071FD095110007A4DE /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };405 402 A3E4DD911F3A803400DED0B4 /* TextStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextStream.cpp; sourceTree = "<group>"; }; 406 403 A3E4DD921F3A803400DED0B4 /* TextStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextStream.h; sourceTree = "<group>"; }; … … 831 828 A8A47277151A825A004123FF /* DataLog.cpp */, 832 829 A8A47278151A825A004123FF /* DataLog.h */, 833 A3CABA061FD095110007A4DE /* DateComponents.cpp */,834 A3CABA071FD095110007A4DE /* DateComponents.h */,835 830 A8A47279151A825A004123FF /* DateMath.cpp */, 836 831 A8A4727A151A825A004123FF /* DateMath.h */, … … 1414 1409 A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */, 1415 1410 A8A4739E151A825B004123FF /* DataLog.cpp in Sources */, 1416 A3CABA081FD095110007A4DE /* DateComponents.cpp in Sources */,1417 1411 A8A473A0151A825B004123FF /* DateMath.cpp in Sources */, 1418 1412 A8A473A2151A825B004123FF /* DecimalNumber.cpp in Sources */, -
trunk/Source/WTF/wtf/CMakeLists.txt
r225524 r225555 233 233 CurrentTime.cpp 234 234 DataLog.cpp 235 DateComponents.cpp236 235 DateMath.cpp 237 236 DecimalNumber.cpp -
trunk/Source/WebCore/ChangeLog
r225554 r225555 1 2017-12-05 Matt Lewis <jlewis3@apple.com> 2 3 Unreviewed, rolling out r225430. 4 5 This caused an API failure on release. 6 7 Reverted changeset: 8 9 "Move DateComponents into WTF" 10 https://bugs.webkit.org/show_bug.cgi?id=180211 11 https://trac.webkit.org/changeset/225430 12 1 13 2017-12-05 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WebCore/Sources.txt
r225524 r225555 1395 1395 platform/ContextMenuItem.cpp 1396 1396 platform/Cursor.cpp 1397 platform/DateComponents.cpp 1397 1398 platform/Decimal.cpp 1398 1399 platform/DragData.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r225524 r225555 2840 2840 A554B5F31E38393A001D4E03 /* PerformanceUserTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A554B5F11E383936001D4E03 /* PerformanceUserTiming.h */; }; 2841 2841 A55639D11C6F09E300806D8E /* WorkerConsoleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */; }; 2842 A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2842 2843 A578F4351DE00EEB003DFC6A /* PromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F4331DE00ED6003DFC6A /* PromiseRejectionEvent.h */; }; 2843 2844 A578F43C1DE01423003DFC6A /* JSPromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F43A1DE013FB003DFC6A /* JSPromiseRejectionEvent.h */; }; … … 10727 10728 A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerConsoleClient.cpp; sourceTree = "<group>"; }; 10728 10729 A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerConsoleClient.h; sourceTree = "<group>"; }; 10730 A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; }; 10731 A5732B09136A161D005C8D7C /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; }; 10729 10732 A578F4321DE00ED6003DFC6A /* PromiseRejectionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PromiseRejectionEvent.cpp; sourceTree = "<group>"; }; 10730 10733 A578F4331DE00ED6003DFC6A /* PromiseRejectionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromiseRejectionEvent.h; sourceTree = "<group>"; }; … … 23486 23489 E11AF15011B9A1A300805103 /* Cursor.cpp */, 23487 23490 F587868402DE3B8601EA4122 /* Cursor.h */, 23491 A5732B08136A161D005C8D7C /* DateComponents.cpp */, 23492 A5732B09136A161D005C8D7C /* DateComponents.h */, 23488 23493 37C738F11EDBDE87003F2B0B /* DateTimeChooser.h */, 23489 23494 37C738F21EDBDE87003F2B0B /* DateTimeChooserClient.h */, … … 26588 26593 E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */, 26589 26594 E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */, 26595 A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */, 26590 26596 F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */, 26591 26597 37C738F31EDBDE8A003F2B0B /* DateTimeChooser.h in Headers */, -
trunk/Source/WebCore/dom/Document.cpp
r225526 r225555 54 54 #include "DOMImplementation.h" 55 55 #include "DOMWindow.h" 56 #include "DateComponents.h" 56 57 #include "DebugPageOverlays.h" 57 58 #include "DocumentLoader.h" -
trunk/Source/WebCore/html/BaseDateAndTimeInputType.h
r225430 r225555 34 34 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 35 35 36 #include "DateComponents.h" 36 37 #include "InputType.h" 37 #include <wtf/DateComponents.h>38 38 39 39 namespace WebCore { -
trunk/Source/WebCore/html/DateTimeInputType.h
r225430 r225555 40 40 class DateTimeInputType final : public BaseChooserOnlyDateAndTimeInputType { 41 41 public: 42 explicit DateTimeInputType(HTMLInputElement& element) 43 : BaseChooserOnlyDateAndTimeInputType(element) { } 42 explicit DateTimeInputType(HTMLInputElement& element) : BaseDateTimeInputType(element) { } 44 43 45 44 private: -
trunk/Source/WebCore/html/HTMLInputElement.h
r225430 r225555 31 31 32 32 #if PLATFORM(IOS) 33 #include <wtf/DateComponents.h>33 #include "DateComponents.h" 34 34 #endif 35 35 -
trunk/Source/WebCore/html/InputType.cpp
r225430 r225555 35 35 #include "ColorInputType.h" 36 36 #include "DOMFormData.h" 37 #include "DateComponents.h" 37 38 #include "DateInputType.h" 38 39 #include "DateTimeInputType.h" … … 75 76 #include <limits> 76 77 #include <wtf/Assertions.h> 77 #include <wtf/DateComponents.h>78 78 #include <wtf/HashMap.h> 79 79 #include <wtf/text/StringHash.h> -
trunk/Source/WebCore/html/InputType.h
r225430 r225555 36 36 #include "RenderPtr.h" 37 37 #include "StepRange.h" 38 #include <wtf/DateComponents.h>39 38 #include <wtf/FastMalloc.h> 40 39 #include <wtf/Forward.h> 41 40 #include <wtf/RefPtr.h> 42 41 42 #if PLATFORM(IOS) 43 #include "DateComponents.h" 44 #endif 45 43 46 namespace WebCore { 44 47 … … 46 49 class Chrome; 47 50 class DOMFormData; 51 class DateComponents; 48 52 class DragData; 49 53 class Event; -
trunk/Source/WebCore/platform/DateComponents.cpp
r225554 r225555 38 38 #include <wtf/text/WTFString.h> 39 39 40 namespace W TF{40 namespace WebCore { 41 41 42 42 // HTML5 specification defines minimum week of year is one. … … 51 51 52 52 static const int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 53 54 static bool isLeapYear(int year) 55 { 56 if (year % 4) 57 return false; 58 if (!(year % 400)) 59 return true; 60 if (!(year % 100)) 61 return false; 62 return true; 63 } 53 64 54 65 // 'month' is 0-based. … … 185 196 day = 1; 186 197 ++month; 187 // month is 0-origin. 188 if (month >= 12) { 198 if (month >= 12) { // month is 0-origin. 189 199 month = 0; 190 200 ++year; … … 716 726 } 717 727 718 } // namespace W TF728 } // namespace WebCore -
trunk/Source/WebCore/platform/DateComponents.h
r225554 r225555 29 29 */ 30 30 31 #pragma once 31 #ifndef DateComponents_h 32 #define DateComponents_h 32 33 33 34 #include <limits> … … 35 36 #include <wtf/Forward.h> 36 37 37 namespace W TF{38 namespace WebCore { 38 39 39 40 // A DateComponents instance represents one of the following date and time combinations: … … 86 87 // Returns an ISO 8601 representation for this instance. 87 88 // The format argument is valid for DateTime, DateTimeLocal, and Time types. 88 WTF_EXPORT_PRIVATE String toString(SecondFormat = None) const;89 String toString(SecondFormat format = None) const; 89 90 90 91 // parse*() and setMillisecondsSince*() functions are initializers for an … … 102 103 103 104 // Sets year and month. 104 WTF_EXPORT_PRIVATEbool parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end);105 bool parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end); 105 106 // Sets year, month and monthDay. 106 WTF_EXPORT_PRIVATEbool parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end);107 bool parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end); 107 108 // Sets year and week. 108 WTF_EXPORT_PRIVATEbool parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end);109 bool parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end); 109 110 // Sets hour, minute, second and millisecond. 110 WTF_EXPORT_PRIVATEbool parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end);111 bool parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end); 111 112 // Sets year, month, monthDay, hour, minute, second and millisecond. 112 WTF_EXPORT_PRIVATEbool parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end);113 bool parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end); 113 114 // Sets year, month, monthDay, hour, minute, second and millisecond, and adjusts timezone. 114 WTF_EXPORT_PRIVATEbool parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end);115 bool parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end); 115 116 116 117 // The following setMillisecondsSinceEpochFor*() functions take … … 121 122 122 123 // For Date type. Updates m_year, m_month and m_monthDay. 123 WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForDate(double);124 bool setMillisecondsSinceEpochForDate(double ms); 124 125 // For DateTime type. Updates m_year, m_month, m_monthDay, m_hour, m_minute, m_second and m_millisecond. 125 WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForDateTime(double);126 bool setMillisecondsSinceEpochForDateTime(double ms); 126 127 // For DateTimeLocal type. Updates m_year, m_month, m_monthDay, m_hour, m_minute, m_second and m_millisecond. 127 WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForDateTimeLocal(double);128 bool setMillisecondsSinceEpochForDateTimeLocal(double ms); 128 129 // For Month type. Updates m_year and m_month. 129 WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForMonth(double);130 bool setMillisecondsSinceEpochForMonth(double ms); 130 131 // For Week type. Updates m_year and m_week. 131 WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForWeek(double);132 bool setMillisecondsSinceEpochForWeek(double ms); 132 133 133 134 // For Time type. Updates m_hour, m_minute, m_second and m_millisecond. 134 WTF_EXPORT_PRIVATE bool setMillisecondsSinceMidnight(double);135 bool setMillisecondsSinceMidnight(double ms); 135 136 136 137 // Another initializer for Month type. Updates m_year and m_month. 137 WTF_EXPORT_PRIVATE bool setMonthsSinceEpoch(double);138 bool setMonthsSinceEpoch(double months); 138 139 139 140 // Returns the number of milliseconds from 1970-01-01 00:00:00 UTC. 140 141 // For a DateComponents initialized with parseDateTimeLocal(), 141 142 // millisecondsSinceEpoch() returns a value for UTC timezone. 142 WTF_EXPORT_PRIVATEdouble millisecondsSinceEpoch() const;143 double millisecondsSinceEpoch() const; 143 144 // Returns the number of months from 1970-01. 144 145 // Do not call this for types other than Month. 145 WTF_EXPORT_PRIVATEdouble monthsSinceEpoch() const;146 double monthsSinceEpoch() const; 146 147 static inline double invalidMilliseconds() { return std::numeric_limits<double>::quiet_NaN(); } 147 148 … … 179 180 double millisecondsSinceEpochForTime() const; 180 181 // Helpers for setMillisecondsSinceEpochFor*(). 181 bool setMillisecondsSinceEpochForDateInternal(double );182 void setMillisecondsSinceMidnightInternal(double );182 bool setMillisecondsSinceEpochForDateInternal(double ms); 183 void setMillisecondsSinceMidnightInternal(double ms); 183 184 // Helper for toString(). 184 185 String toStringForTime(SecondFormat) const; … … 208 209 209 210 210 } // namespace W TF211 212 using WTF::DateComponents; 211 } // namespace WebCore 212 213 #endif // DateComponents_h -
trunk/Source/WebCore/platform/text/PlatformLocale.h
r225430 r225555 24 24 */ 25 25 26 #pragma once 26 #ifndef PlatformLocale_h 27 #define PlatformLocale_h 27 28 28 #include <wtf/DateComponents.h>29 #include "DateComponents.h" 29 30 #include <wtf/Language.h> 30 31 #include <wtf/text/WTFString.h> … … 155 156 156 157 } 158 #endif -
trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h
r225430 r225555 29 29 #if PLATFORM(IOS) 30 30 31 #include "DateComponents.h" 31 32 #include "FontCascade.h" 32 #include <wtf/DateComponents.h>33 33 #include <wtf/HashMap.h> 34 34 #include <wtf/RetainPtr.h> -
trunk/Source/WebCore/platform/text/mac/LocaleMac.h
r225430 r225555 29 29 */ 30 30 31 #pragma once 31 #ifndef LocaleMac_h 32 #define LocaleMac_h 32 33 33 34 #include "PlatformLocale.h" … … 41 42 OBJC_CLASS NSLocale; 42 43 43 namespace WTF { 44 namespace WebCore { 45 44 46 class DateComponents; 45 }46 47 namespace WebCore {48 47 49 48 class LocaleMac : public Locale { … … 100 99 101 100 } // namespace WebCore 101 #endif -
trunk/Source/WebCore/platform/text/win/LocaleWin.cpp
r225430 r225555 32 32 #include "LocaleWin.h" 33 33 34 #include "DateComponents.h" 34 35 #include "DateTimeFormat.h" 35 36 #include "LocalizedStrings.h" -
trunk/Source/WebCore/platform/text/win/LocaleWin.h
r225430 r225555 29 29 */ 30 30 31 #pragma once 31 #ifndef LocaleWin_h 32 #define LocaleWin_h 32 33 33 34 #include "PlatformLocale.h" … … 39 40 namespace WebCore { 40 41 42 class DateComponents; 41 43 struct DateFormatToken; 42 44 … … 87 89 88 90 } // namespace WebCore 91 #endif -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r225430 r225555 33 33 #import "CSSToLengthConversionData.h" 34 34 #import "CSSValueKeywords.h" 35 #import "DateComponents.h" 35 36 #import "Document.h" 36 37 #import "File.h" … … 70 71 #import <pal/spi/cocoa/CoreTextSPI.h> 71 72 #import <pal/spi/ios/UIKitSPI.h> 72 #import <wtf/DateComponents.h>73 73 #import <wtf/NeverDestroyed.h> 74 74 #import <wtf/RefPtr.h>
Note: See TracChangeset
for help on using the changeset viewer.