Title: [230774] trunk
Revision
230774
Author
[email protected]
Date
2018-04-18 13:09:24 -0700 (Wed, 18 Apr 2018)

Log Message

[Win] Layout Test js/date-constructor.html is failing
https://bugs.webkit.org/show_bug.cgi?id=140945

Reviewed by Per Arne Vollan.

Source/WTF:

* wtf/DateMath.cpp:
(WTF::calculateDSTOffset):
Move all shared calculations outside of the #if -- including the "jump forward a day" case that had been overlooked.

LayoutTests:

* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (230773 => 230774)


--- trunk/LayoutTests/ChangeLog	2018-04-18 19:17:08 UTC (rev 230773)
+++ trunk/LayoutTests/ChangeLog	2018-04-18 20:09:24 UTC (rev 230774)
@@ -1,3 +1,13 @@
+2018-04-18  Ross Kirsling  <[email protected]>
+
+        [Win] Layout Test js/date-constructor.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=140945
+
+        Reviewed by Per Arne Vollan.
+
+        * platform/win/TestExpectations:
+        * platform/wincairo/TestExpectations:
+
 2018-04-18  Chris Dumez  <[email protected]>
 
         Add support for converting a local window to a remote window

Modified: trunk/LayoutTests/platform/win/TestExpectations (230773 => 230774)


--- trunk/LayoutTests/platform/win/TestExpectations	2018-04-18 19:17:08 UTC (rev 230773)
+++ trunk/LayoutTests/platform/win/TestExpectations	2018-04-18 20:09:24 UTC (rev 230774)
@@ -2450,7 +2450,6 @@
 # Skip tests that fail only in Debug mode 
 webkit.org/b/140947 [ Debug ] js/slow-stress [ Skip ]
 
-webkit.org/b/140945 js/date-constructor.html [ Failure ]
 webkit.org/b/127492 js/dom/date-big-constructor.html [ Failure ]
 webkit.org/b/140847 js/dom/date-negative-setmonth.html [ Failure ]
 js/dom/dom-static-property-for-in-iteration.html [ Failure ]

Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (230773 => 230774)


--- trunk/LayoutTests/platform/wincairo/TestExpectations	2018-04-18 19:17:08 UTC (rev 230773)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations	2018-04-18 20:09:24 UTC (rev 230774)
@@ -1525,7 +1525,6 @@
 imported/mozilla [ Skip ]
 imported/w3c [ Skip ]
 inspector [ Skip ]
-js/date-constructor.html [ Skip ]
 js/regexp-unicode.html [ Skip ]
 js/dom [ Skip ]
 legacy-animation-engine/media [ Skip ]

Modified: trunk/Source/WTF/ChangeLog (230773 => 230774)


--- trunk/Source/WTF/ChangeLog	2018-04-18 19:17:08 UTC (rev 230773)
+++ trunk/Source/WTF/ChangeLog	2018-04-18 20:09:24 UTC (rev 230774)
@@ -1,3 +1,14 @@
+2018-04-18  Ross Kirsling  <[email protected]>
+
+        [Win] Layout Test js/date-constructor.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=140945
+
+        Reviewed by Per Arne Vollan.
+
+        * wtf/DateMath.cpp:
+        (WTF::calculateDSTOffset):
+        Move all shared calculations outside of the #if -- including the "jump forward a day" case that had been overlooked.
+
 2018-04-17  Saam Barati  <[email protected]>
 
         Add system trace points for process launch and for initializeWebProcess

Modified: trunk/Source/WTF/wtf/DateMath.cpp (230773 => 230774)


--- trunk/Source/WTF/wtf/DateMath.cpp	2018-04-18 19:17:08 UTC (rev 230773)
+++ trunk/Source/WTF/wtf/DateMath.cpp	2018-04-18 20:09:24 UTC (rev 230774)
@@ -464,6 +464,13 @@
  */
 static double calculateDSTOffset(time_t localTime, double utcOffset)
 {
+    // input is UTC so we have to shift back to local time to determine DST thus the + getUTCOffset()
+    double offsetTime = (localTime * msPerSecond) + utcOffset;
+
+    // Offset from UTC but doesn't include DST obviously
+    int offsetHour =  msToHours(offsetTime);
+    int offsetMinute =  msToMinutes(offsetTime);
+
 #if OS(WINDOWS)
     FILETIME utcFileTime;
     UnixTimeToFileTime(localTime, &utcFileTime);
@@ -473,33 +480,18 @@
     if (!::SystemTimeToTzSpecificLocalTime(nullptr, &utcSystemTime, &localSystemTime))
         return 0;
 
-    double offsetTime = (localTime * msPerSecond) + utcOffset;
-
-    // Offset from UTC but doesn't include DST obviously
-    int offsetHour =  msToHours(offsetTime);
-    int offsetMinute =  msToMinutes(offsetTime);
-
     double diff = ((localSystemTime.wHour - offsetHour) * secondsPerHour) + ((localSystemTime.wMinute - offsetMinute) * 60);
-
-    return diff * msPerSecond;
 #else
-    //input is UTC so we have to shift back to local time to determine DST thus the + getUTCOffset()
-    double offsetTime = (localTime * msPerSecond) + utcOffset;
-
-    // Offset from UTC but doesn't include DST obviously
-    int offsetHour =  msToHours(offsetTime);
-    int offsetMinute =  msToMinutes(offsetTime);
-
     tm localTM;
     getLocalTime(&localTime, &localTM);
 
     double diff = ((localTM.tm_hour - offsetHour) * secondsPerHour) + ((localTM.tm_min - offsetMinute) * 60);
+#endif
 
     if (diff < 0)
         diff += secondsPerDay;
 
     return (diff * msPerSecond);
-#endif
 }
 
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to