Changeset 217458 in webkit
- Timestamp:
- May 25, 2017 5:06:44 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r217438 r217458 1 2017-05-25 Keith Miller <keith_miller@apple.com> 2 3 Date should use historical data if it's available. 4 https://bugs.webkit.org/show_bug.cgi?id=172592 5 6 Reviewed by Mark Lam. 7 8 Remove parts of the date tests that rely on the absence of 9 historical data in Date. 10 11 * mozilla/ecma/Date/15.9.5.31-1.js: 12 (getTestCases): 13 * mozilla/ecma/Date/15.9.5.35-1.js: 14 (getTestCases): 15 1 16 2017-05-25 Saam Barati <sbarati@apple.com> 2 17 -
trunk/JSTests/mozilla/ecma/Date/15.9.5.31-1.js
r11995 r217458 90 90 LocalDateFromTime(SetUTCHours(28800000,-8670)) ); 91 91 92 // This test is commented out because it relies on non-historical data, which is allowed now. 93 /* 92 94 addNewTestCase( 946684800000, 1234567, void 0, void 0, void 0, 93 95 "TDATE = new Date(946684800000);(TDATE).setUTCHours(1234567);TDATE", 94 96 UTCDateFromTime(SetUTCHours(946684800000,1234567)), 95 97 LocalDateFromTime(SetUTCHours(946684800000,1234567)) ); 96 98 */ 97 99 addNewTestCase( -2208988800000, 59, 999, void 0, void 0, 98 100 "TDATE = new Date(-2208988800000);(TDATE).setUTCHours(59,999);TDATE", -
trunk/JSTests/mozilla/ecma/Date/15.9.5.35-1.js
r11995 r217458 59 59 LocalDateFromTime(SetUTCMonth(0,11)) ); 60 60 61 // This test is commented out because it relies on non-historical data, which is allowed now. 62 /* 61 63 addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMonth(3,4);TDATE", 62 64 UTCDateFromTime(SetUTCMonth(0,3,4)), 63 65 LocalDateFromTime(SetUTCMonth(0,3,4)) ); 64 66 */ 65 67 } 66 68 -
trunk/LayoutTests/ChangeLog
r217445 r217458 1 2017-05-25 Keith Miller <keith_miller@apple.com> 2 3 Date should use historical data if it's available. 4 https://bugs.webkit.org/show_bug.cgi?id=172592 5 6 Reviewed by Mark Lam. 7 8 Fix tests to work with historically accurate dates. 9 10 * js/dom/date-big-setdate-expected.txt: Removed. 11 * js/dom/date-big-setdate.html: Removed. 12 * js/dom/script-tests/date-big-setdate.js: Removed. 13 * storage/indexeddb/modern/date-basic-expected.txt: 14 * storage/indexeddb/modern/date-basic-private-expected.txt: 15 * storage/indexeddb/modern/get-keyrange-expected.txt: 16 * storage/indexeddb/modern/get-keyrange-private-expected.txt: 17 1 18 2017-05-25 Chris Dumez <cdumez@apple.com> 2 19 -
trunk/LayoutTests/storage/indexeddb/modern/date-basic-expected.txt
r195380 r217458 10 10 Initial upgrade needed: Old version - 0 New version - 1 11 11 Initial upgrade versionchange transaction complete 12 Success getting key 'Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT)' of type object, result is 'Flux capacitor' of type string12 Success getting key 'Fri Nov 04 1955 16:00:00 GMT-0800 (PST)' of type object, result is 'Flux capacitor' of type string 13 13 Key is a Date object, btw 14 14 Success getting key 'Sat Nov 12 1955 10:00:00 GMT-0800 (PST)' of type object, result is 'Fish under the sea' of type string … … 16 16 Success getting key 'Wed Oct 21 2015 09:00:00 GMT-0700 (PDT)' of type object, result is 'Hoverboards' of type string 17 17 Key is a Date object, btw 18 Success getting key 'a' of type string, result is 'Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT)' of type object18 Success getting key 'a' of type string, result is 'Fri Nov 04 1955 16:00:00 GMT-0800 (PST)' of type object 19 19 Result is a Date object, btw 20 20 Success getting key 'b' of type string, result is 'Sat Nov 12 1955 10:00:00 GMT-0800 (PST)' of type object -
trunk/LayoutTests/storage/indexeddb/modern/date-basic-private-expected.txt
r195394 r217458 10 10 Initial upgrade needed: Old version - 0 New version - 1 11 11 Initial upgrade versionchange transaction complete 12 Success getting key 'Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT)' of type object, result is 'Flux capacitor' of type string12 Success getting key 'Fri Nov 04 1955 16:00:00 GMT-0800 (PST)' of type object, result is 'Flux capacitor' of type string 13 13 Key is a Date object, btw 14 14 Success getting key 'Sat Nov 12 1955 10:00:00 GMT-0800 (PST)' of type object, result is 'Fish under the sea' of type string … … 16 16 Success getting key 'Wed Oct 21 2015 09:00:00 GMT-0700 (PDT)' of type object, result is 'Hoverboards' of type string 17 17 Key is a Date object, btw 18 Success getting key 'a' of type string, result is 'Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT)' of type object18 Success getting key 'a' of type string, result is 'Fri Nov 04 1955 16:00:00 GMT-0800 (PST)' of type object 19 19 Result is a Date object, btw 20 20 Success getting key 'b' of type string, result is 'Sat Nov 12 1955 10:00:00 GMT-0800 (PST)' of type object -
trunk/LayoutTests/storage/indexeddb/modern/get-keyrange-expected.txt
r195380 r217458 124 124 Success getting keyRange [Infinity (Open), a (Open)] 125 125 Result is Flux capacitor 126 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)]126 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)] 127 127 Result is Flux capacitor 128 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)]128 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)] 129 129 Result is Fish under the sea 130 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)]130 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)] 131 131 Result is Flux capacitor 132 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)]132 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)] 133 133 Result is Fish under the sea 134 134 readonly transaction complete -
trunk/LayoutTests/storage/indexeddb/modern/get-keyrange-private-expected.txt
r195394 r217458 124 124 Success getting keyRange [Infinity (Open), a (Open)] 125 125 Result is Flux capacitor 126 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)]126 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)] 127 127 Result is Flux capacitor 128 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)]128 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Closed)] 129 129 Result is Fish under the sea 130 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)]130 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Closed), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)] 131 131 Result is Flux capacitor 132 Success getting keyRange [Fri Nov 04 1955 1 7:00:00 GMT-0700 (PDT) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)]132 Success getting keyRange [Fri Nov 04 1955 16:00:00 GMT-0800 (PST) (Open), Wed Oct 21 2015 09:00:00 GMT-0700 (PDT) (Open)] 133 133 Result is Fish under the sea 134 134 readonly transaction complete -
trunk/Source/WTF/ChangeLog
r217432 r217458 1 2017-05-25 Keith Miller <keith_miller@apple.com> 2 3 Date should use historical data if it's available. 4 https://bugs.webkit.org/show_bug.cgi?id=172592 5 6 Reviewed by Mark Lam. 7 8 The spec previously disallowed using historical data for Dates. 9 This is no longer the case. Additionally, not using historical 10 data, when available, seems unfortunate for users. This patch 11 removes the code dropping historical data. 12 13 * wtf/DateMath.cpp: 14 (WTF::calculateLocalTimeOffset): 15 (WTF::msToMilliseconds): Deleted. 16 1 17 2017-05-25 Yusuke Suzuki <utatane.tea@gmail.com> 2 18 -
trunk/Source/WTF/wtf/DateMath.cpp
r215359 r217458 197 197 } 198 198 199 static inline double msToMilliseconds(double ms)200 {201 double result = fmod(ms, msPerDay);202 if (result < 0)203 result += msPerDay;204 return result;205 }206 207 199 int msToMinutes(double ms) 208 200 { … … 513 505 if (inputTimeType == LocalTime) 514 506 ms -= localToUTCTimeOffset; 515 516 // On Mac OS X, the call to localtime (see calculateDSTOffset) will return historically accurate517 // DST information (e.g. New Zealand did not have DST from 1946 to 1974) however the JavaScript518 // standard explicitly dictates that historical information should not be considered when519 // determining DST. For this reason we shift away from years that localtime can handle but would520 // return historically accurate information.521 int year = msToYear(ms);522 int equivalentYear = equivalentYearForDST(year);523 if (year != equivalentYear) {524 bool leapYear = isLeapYear(year);525 int dayInYearLocal = dayInYear(ms, year);526 int dayInMonth = dayInMonthFromDayInYear(dayInYearLocal, leapYear);527 int month = monthFromDayInYear(dayInYearLocal, leapYear);528 double day = dateToDaysFrom1970(equivalentYear, month, dayInMonth);529 ms = (day * msPerDay) + msToMilliseconds(ms);530 }531 507 532 508 double localTimeSeconds = ms / msPerSecond;
Note: See TracChangeset
for help on using the changeset viewer.