Changeset 225555 in webkit


Ignore:
Timestamp:
Dec 5, 2017 3:59:31 PM (6 years ago)
Author:
Matt Lewis
Message:

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

Location:
trunk/Source
Files:
18 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r225552 r225555  
     12017-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
    1132017-12-05  Michael Saboff  <msaboff@apple.com>
    214
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r225524 r225555  
    8686                9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; };
    8787                A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */; };
    88                 A3CABA081FD095110007A4DE /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3CABA061FD095110007A4DE /* DateComponents.cpp */; };
    8988                A3E4DD931F3A803400DED0B4 /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E4DD911F3A803400DED0B4 /* TextStream.cpp */; };
    9089                A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; };
     
    401400                A30D412D1F0DE13F00B71954 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };
    402401                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>"; };
    405402                A3E4DD911F3A803400DED0B4 /* TextStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextStream.cpp; sourceTree = "<group>"; };
    406403                A3E4DD921F3A803400DED0B4 /* TextStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextStream.h; sourceTree = "<group>"; };
     
    831828                                A8A47277151A825A004123FF /* DataLog.cpp */,
    832829                                A8A47278151A825A004123FF /* DataLog.h */,
    833                                 A3CABA061FD095110007A4DE /* DateComponents.cpp */,
    834                                 A3CABA071FD095110007A4DE /* DateComponents.h */,
    835830                                A8A47279151A825A004123FF /* DateMath.cpp */,
    836831                                A8A4727A151A825A004123FF /* DateMath.h */,
     
    14141409                                A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */,
    14151410                                A8A4739E151A825B004123FF /* DataLog.cpp in Sources */,
    1416                                 A3CABA081FD095110007A4DE /* DateComponents.cpp in Sources */,
    14171411                                A8A473A0151A825B004123FF /* DateMath.cpp in Sources */,
    14181412                                A8A473A2151A825B004123FF /* DecimalNumber.cpp in Sources */,
  • trunk/Source/WTF/wtf/CMakeLists.txt

    r225524 r225555  
    233233    CurrentTime.cpp
    234234    DataLog.cpp
    235     DateComponents.cpp
    236235    DateMath.cpp
    237236    DecimalNumber.cpp
  • trunk/Source/WebCore/ChangeLog

    r225554 r225555  
     12017-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
    1132017-12-05  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/Source/WebCore/Sources.txt

    r225524 r225555  
    13951395platform/ContextMenuItem.cpp
    13961396platform/Cursor.cpp
     1397platform/DateComponents.cpp
    13971398platform/Decimal.cpp
    13981399platform/DragData.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r225524 r225555  
    28402840                A554B5F31E38393A001D4E03 /* PerformanceUserTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A554B5F11E383936001D4E03 /* PerformanceUserTiming.h */; };
    28412841                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, ); }; };
    28422843                A578F4351DE00EEB003DFC6A /* PromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F4331DE00ED6003DFC6A /* PromiseRejectionEvent.h */; };
    28432844                A578F43C1DE01423003DFC6A /* JSPromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F43A1DE013FB003DFC6A /* JSPromiseRejectionEvent.h */; };
     
    1072710728                A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerConsoleClient.cpp; sourceTree = "<group>"; };
    1072810729                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>"; };
    1072910732                A578F4321DE00ED6003DFC6A /* PromiseRejectionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PromiseRejectionEvent.cpp; sourceTree = "<group>"; };
    1073010733                A578F4331DE00ED6003DFC6A /* PromiseRejectionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromiseRejectionEvent.h; sourceTree = "<group>"; };
     
    2348623489                                E11AF15011B9A1A300805103 /* Cursor.cpp */,
    2348723490                                F587868402DE3B8601EA4122 /* Cursor.h */,
     23491                                A5732B08136A161D005C8D7C /* DateComponents.cpp */,
     23492                                A5732B09136A161D005C8D7C /* DateComponents.h */,
    2348823493                                37C738F11EDBDE87003F2B0B /* DateTimeChooser.h */,
    2348923494                                37C738F21EDBDE87003F2B0B /* DateTimeChooserClient.h */,
     
    2658826593                                E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
    2658926594                                E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
     26595                                A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */,
    2659026596                                F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */,
    2659126597                                37C738F31EDBDE8A003F2B0B /* DateTimeChooser.h in Headers */,
  • trunk/Source/WebCore/dom/Document.cpp

    r225526 r225555  
    5454#include "DOMImplementation.h"
    5555#include "DOMWindow.h"
     56#include "DateComponents.h"
    5657#include "DebugPageOverlays.h"
    5758#include "DocumentLoader.h"
  • trunk/Source/WebCore/html/BaseDateAndTimeInputType.h

    r225430 r225555  
    3434#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    3535
     36#include "DateComponents.h"
    3637#include "InputType.h"
    37 #include <wtf/DateComponents.h>
    3838
    3939namespace WebCore {
  • trunk/Source/WebCore/html/DateTimeInputType.h

    r225430 r225555  
    4040class DateTimeInputType final : public BaseChooserOnlyDateAndTimeInputType {
    4141public:
    42     explicit DateTimeInputType(HTMLInputElement& element)
    43         : BaseChooserOnlyDateAndTimeInputType(element) { }
     42    explicit DateTimeInputType(HTMLInputElement& element) : BaseDateTimeInputType(element) { }
    4443
    4544private:
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r225430 r225555  
    3131
    3232#if PLATFORM(IOS)
    33 #include <wtf/DateComponents.h>
     33#include "DateComponents.h"
    3434#endif
    3535
  • trunk/Source/WebCore/html/InputType.cpp

    r225430 r225555  
    3535#include "ColorInputType.h"
    3636#include "DOMFormData.h"
     37#include "DateComponents.h"
    3738#include "DateInputType.h"
    3839#include "DateTimeInputType.h"
     
    7576#include <limits>
    7677#include <wtf/Assertions.h>
    77 #include <wtf/DateComponents.h>
    7878#include <wtf/HashMap.h>
    7979#include <wtf/text/StringHash.h>
  • trunk/Source/WebCore/html/InputType.h

    r225430 r225555  
    3636#include "RenderPtr.h"
    3737#include "StepRange.h"
    38 #include <wtf/DateComponents.h>
    3938#include <wtf/FastMalloc.h>
    4039#include <wtf/Forward.h>
    4140#include <wtf/RefPtr.h>
    4241
     42#if PLATFORM(IOS)
     43#include "DateComponents.h"
     44#endif
     45
    4346namespace WebCore {
    4447
     
    4649class Chrome;
    4750class DOMFormData;
     51class DateComponents;
    4852class DragData;
    4953class Event;
  • trunk/Source/WebCore/platform/DateComponents.cpp

    r225554 r225555  
    3838#include <wtf/text/WTFString.h>
    3939
    40 namespace WTF {
     40namespace WebCore {
    4141
    4242// HTML5 specification defines minimum week of year is one.
     
    5151
    5252static const int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
     53
     54static 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}
    5364
    5465// 'month' is 0-based.
     
    185196                day = 1;
    186197                ++month;
    187                 // month is 0-origin.
    188                 if (month >= 12) {
     198                if (month >= 12) { // month is 0-origin.
    189199                    month = 0;
    190200                    ++year;
     
    716726}
    717727
    718 } // namespace WTF
     728} // namespace WebCore
  • trunk/Source/WebCore/platform/DateComponents.h

    r225554 r225555  
    2929 */
    3030
    31 #pragma once
     31#ifndef DateComponents_h
     32#define DateComponents_h
    3233
    3334#include <limits>
     
    3536#include <wtf/Forward.h>
    3637
    37 namespace WTF {
     38namespace WebCore {
    3839
    3940// A DateComponents instance represents one of the following date and time combinations:
     
    8687    // Returns an ISO 8601 representation for this instance.
    8788    // 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;
    8990
    9091    // parse*() and setMillisecondsSince*() functions are initializers for an
     
    102103
    103104    // Sets year and month.
    104     WTF_EXPORT_PRIVATE bool parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end);
     105    bool parseMonth(const UChar* src, unsigned length, unsigned start, unsigned& end);
    105106    // Sets year, month and monthDay.
    106     WTF_EXPORT_PRIVATE bool parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end);
     107    bool parseDate(const UChar* src, unsigned length, unsigned start, unsigned& end);
    107108    // Sets year and week.
    108     WTF_EXPORT_PRIVATE bool parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end);
     109    bool parseWeek(const UChar* src, unsigned length, unsigned start, unsigned& end);
    109110    // Sets hour, minute, second and millisecond.
    110     WTF_EXPORT_PRIVATE bool parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
     111    bool parseTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
    111112    // Sets year, month, monthDay, hour, minute, second and millisecond.
    112     WTF_EXPORT_PRIVATE bool parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end);
     113    bool parseDateTimeLocal(const UChar* src, unsigned length, unsigned start, unsigned& end);
    113114    // Sets year, month, monthDay, hour, minute, second and millisecond, and adjusts timezone.
    114     WTF_EXPORT_PRIVATE bool parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
     115    bool parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
    115116
    116117    // The following setMillisecondsSinceEpochFor*() functions take
     
    121122
    122123    // For Date type. Updates m_year, m_month and m_monthDay.
    123     WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForDate(double);
     124    bool setMillisecondsSinceEpochForDate(double ms);
    124125    // 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);
    126127    // 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);
    128129    // For Month type. Updates m_year and m_month.
    129     WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForMonth(double);
     130    bool setMillisecondsSinceEpochForMonth(double ms);
    130131    // For Week type. Updates m_year and m_week.
    131     WTF_EXPORT_PRIVATE bool setMillisecondsSinceEpochForWeek(double);
     132    bool setMillisecondsSinceEpochForWeek(double ms);
    132133
    133134    // 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);
    135136
    136137    // Another initializer for Month type. Updates m_year and m_month.
    137     WTF_EXPORT_PRIVATE bool setMonthsSinceEpoch(double);
     138    bool setMonthsSinceEpoch(double months);
    138139
    139140    // Returns the number of milliseconds from 1970-01-01 00:00:00 UTC.
    140141    // For a DateComponents initialized with parseDateTimeLocal(),
    141142    // millisecondsSinceEpoch() returns a value for UTC timezone.
    142     WTF_EXPORT_PRIVATE double millisecondsSinceEpoch() const;
     143    double millisecondsSinceEpoch() const;
    143144    // Returns the number of months from 1970-01.
    144145    // Do not call this for types other than Month.
    145     WTF_EXPORT_PRIVATE double monthsSinceEpoch() const;
     146    double monthsSinceEpoch() const;
    146147    static inline double invalidMilliseconds() { return std::numeric_limits<double>::quiet_NaN(); }
    147148
     
    179180    double millisecondsSinceEpochForTime() const;
    180181    // Helpers for setMillisecondsSinceEpochFor*().
    181     bool setMillisecondsSinceEpochForDateInternal(double);
    182     void setMillisecondsSinceMidnightInternal(double);
     182    bool setMillisecondsSinceEpochForDateInternal(double ms);
     183    void setMillisecondsSinceMidnightInternal(double ms);
    183184    // Helper for toString().
    184185    String toStringForTime(SecondFormat) const;
     
    208209
    209210
    210 } // namespace WTF
    211 
    212 using WTF::DateComponents;
     211} // namespace WebCore
     212
     213#endif // DateComponents_h
  • trunk/Source/WebCore/platform/text/PlatformLocale.h

    r225430 r225555  
    2424 */
    2525
    26 #pragma once
     26#ifndef PlatformLocale_h
     27#define PlatformLocale_h
    2728
    28 #include <wtf/DateComponents.h>
     29#include "DateComponents.h"
    2930#include <wtf/Language.h>
    3031#include <wtf/text/WTFString.h>
     
    155156
    156157}
     158#endif
  • trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h

    r225430 r225555  
    2929#if PLATFORM(IOS)
    3030
     31#include "DateComponents.h"
    3132#include "FontCascade.h"
    32 #include <wtf/DateComponents.h>
    3333#include <wtf/HashMap.h>
    3434#include <wtf/RetainPtr.h>
  • trunk/Source/WebCore/platform/text/mac/LocaleMac.h

    r225430 r225555  
    2929 */
    3030
    31 #pragma once
     31#ifndef LocaleMac_h
     32#define LocaleMac_h
    3233
    3334#include "PlatformLocale.h"
     
    4142OBJC_CLASS NSLocale;
    4243
    43 namespace WTF {
     44namespace WebCore {
     45
    4446class DateComponents;
    45 }
    46 
    47 namespace WebCore {
    4847
    4948class LocaleMac : public Locale {
     
    10099
    101100} // namespace WebCore
     101#endif
  • trunk/Source/WebCore/platform/text/win/LocaleWin.cpp

    r225430 r225555  
    3232#include "LocaleWin.h"
    3333
     34#include "DateComponents.h"
    3435#include "DateTimeFormat.h"
    3536#include "LocalizedStrings.h"
  • trunk/Source/WebCore/platform/text/win/LocaleWin.h

    r225430 r225555  
    2929 */
    3030
    31 #pragma once
     31#ifndef LocaleWin_h
     32#define LocaleWin_h
    3233
    3334#include "PlatformLocale.h"
     
    3940namespace WebCore {
    4041
     42class DateComponents;
    4143struct DateFormatToken;
    4244
     
    8789
    8890} // namespace WebCore
     91#endif
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r225430 r225555  
    3333#import "CSSToLengthConversionData.h"
    3434#import "CSSValueKeywords.h"
     35#import "DateComponents.h"
    3536#import "Document.h"
    3637#import "File.h"
     
    7071#import <pal/spi/cocoa/CoreTextSPI.h>
    7172#import <pal/spi/ios/UIKitSPI.h>
    72 #import <wtf/DateComponents.h>
    7373#import <wtf/NeverDestroyed.h>
    7474#import <wtf/RefPtr.h>
Note: See TracChangeset for help on using the changeset viewer.