<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[184451] releases/WebKitGTK/webkit-2.4</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/184451">184451</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-05-18 03:04:34 -0700 (Mon, 18 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/175078">r175078</a> - String(new Date(Mar 30 2014 01:00:00)) is wrong in CET
https://bugs.webkit.org/show_bug.cgi?id=130967

Patch by Byungseon Shin &lt;sun.shin@lge.com&gt; on 2014-10-22
Reviewed by Mark Lam.

Source/JavaScriptCore:

By definition of calculateLocalTimeOffset, input time should be UTC time.
But there are many cases when input time is based on local time.
So, it gives erroneous results while calculating offset of DST boundary time.
By adding a argument to distinguish UTC and local time, we can get the correct offset.

* JavaScriptCore.order:
* runtime/DateConstructor.cpp:
(JSC::constructDate):
(JSC::callDate):
(JSC::dateUTC):
* runtime/DateInstance.cpp:
(JSC::DateInstance::calculateGregorianDateTime):
(JSC::DateInstance::calculateGregorianDateTimeUTC):
* runtime/DatePrototype.cpp:
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetMilliSeconds):
(JSC::dateProtoFuncSetUTCMilliseconds):
(JSC::dateProtoFuncSetSeconds):
(JSC::dateProtoFuncSetUTCSeconds):
(JSC::dateProtoFuncSetMinutes):
(JSC::dateProtoFuncSetUTCMinutes):
(JSC::dateProtoFuncSetHours):
(JSC::dateProtoFuncSetUTCHours):
(JSC::dateProtoFuncSetDate):
(JSC::dateProtoFuncSetUTCDate):
(JSC::dateProtoFuncSetMonth):
(JSC::dateProtoFuncSetUTCMonth):
(JSC::dateProtoFuncSetFullYear):
(JSC::dateProtoFuncSetUTCFullYear):
(JSC::dateProtoFuncSetYear):
* runtime/JSDateMath.cpp:
(JSC::localTimeOffset):
(JSC::gregorianDateTimeToMS):
(JSC::msToGregorianDateTime):
(JSC::parseDateFromNullTerminatedCharacters):
* runtime/JSDateMath.h:
* runtime/VM.h:
(JSC::LocalTimeOffsetCache::LocalTimeOffsetCache):
(JSC::LocalTimeOffsetCache::reset):
Passing TimeType argument to distingush UTC time and local time.

Source/WTF:

By definition of calculateLocalTimeOffset, input time should be UTC time.
But there are many cases when input time is based on local time.
So, it gives erroneous results while calculating offset of DST boundary time.
By adding a argument to distinguish UTC and local time, we can get the correct offset.

* wtf/DateMath.cpp:
(WTF::calculateLocalTimeOffset):
(WTF::parseDateFromNullTerminatedCharacters):
Compensate time offset depends on UTC time or local time.
* wtf/DateMath.h:
Add argument to differenciate UTC or local time.

LayoutTests:

Set latest DST timezone boundary values on
&lt;http://www.timeanddate.com/time/zone/usa/los-angeles&gt;

* js/dom/script-tests/date-DST-time-cusps.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsjsdomscripttestsdateDSTtimecuspsjs">releases/WebKitGTK/webkit-2.4/LayoutTests/js/dom/script-tests/date-DST-time-cusps.js</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreJavaScriptCoreorder">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/JavaScriptCore.order</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeDateConstructorcpp">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateConstructor.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeDateInstancecpp">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateInstance.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeDatePrototypecpp">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DatePrototype.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeJSDateMathcpp">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeJSDateMathh">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeVMh">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWTFChangeLog">releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWTFwtfDateMathcpp">releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWTFwtfDateMathh">releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit24LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-10-22  Byungseon Shin  &lt;sun.shin@lge.com&gt;
+
+        String(new Date(Mar 30 2014 01:00:00)) is wrong in CET
+        https://bugs.webkit.org/show_bug.cgi?id=130967
+
+        Reviewed by Mark Lam.
+
+        Set latest DST timezone boundary values on
+        &lt;http://www.timeanddate.com/time/zone/usa/los-angeles&gt;
+
+        * js/dom/script-tests/date-DST-time-cusps.js:
+
</ins><span class="cx"> 2014-10-22  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         SVG loaded through html &lt;img&gt; can't request to load any external resources.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24LayoutTestsjsdomscripttestsdateDSTtimecuspsjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/LayoutTests/js/dom/script-tests/date-DST-time-cusps.js (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/js/dom/script-tests/date-DST-time-cusps.js        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/js/dom/script-tests/date-DST-time-cusps.js        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -7,11 +7,11 @@
</span><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> var testCases = [];
</span><del>-if ((new Date(2009, 9, 1)).toString().match(&quot;PDT&quot;)) {
-    testCases.push([&quot;(new Date(1982, 2, 14, 2, 10)).getHours()&quot;, &quot;3&quot;]);
-    testCases.push([&quot;(new Date(1982, 2, 14, 2)).getHours()&quot;, &quot;3&quot;]);
-    testCases.push([&quot;(new Date(1982, 11, 7, 1, 10)).getTimezoneOffset()&quot;, &quot;480&quot;]);
-    testCases.push([&quot;(new Date(1982, 11, 7, 1)).getTimezoneOffset()&quot;, &quot;480&quot;]);
</del><ins>+if ((new Date(2014, 8, 1)).toString().match(&quot;PDT&quot;)) {
+    testCases.push([&quot;(new Date('Mar 09 2014 03:00:00')).getHours()&quot;, &quot;3&quot;]);
+    testCases.push([&quot;(new Date('Mar 09 2014 03:00:00')).getTimezoneOffset()&quot;, &quot;420&quot;]);
+    testCases.push([&quot;(new Date('Nov 02 2014 01:00:00')).getHours()&quot;, &quot;1&quot;]);
+    testCases.push([&quot;(new Date('Nov 02 2014 01:00:00')).getTimezoneOffset()&quot;, &quot;480&quot;]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> var errors = [];
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-10-22  Byungseon Shin  &lt;sun.shin@lge.com&gt;
+
+        String(new Date(Mar 30 2014 01:00:00)) is wrong in CET
+        https://bugs.webkit.org/show_bug.cgi?id=130967
+
+        Reviewed by Mark Lam.
+
+        By definition of calculateLocalTimeOffset, input time should be UTC time.
+        But there are many cases when input time is based on local time.
+        So, it gives erroneous results while calculating offset of DST boundary time.
+        By adding a argument to distinguish UTC and local time, we can get the correct offset.
+
+        * JavaScriptCore.order:
+        * runtime/DateConstructor.cpp:
+        (JSC::constructDate):
+        (JSC::callDate):
+        (JSC::dateUTC):
+        * runtime/DateInstance.cpp:
+        (JSC::DateInstance::calculateGregorianDateTime):
+        (JSC::DateInstance::calculateGregorianDateTimeUTC):
+        * runtime/DatePrototype.cpp:
+        (JSC::setNewValueFromTimeArgs):
+        (JSC::setNewValueFromDateArgs):
+        (JSC::dateProtoFuncSetMilliSeconds):
+        (JSC::dateProtoFuncSetUTCMilliseconds):
+        (JSC::dateProtoFuncSetSeconds):
+        (JSC::dateProtoFuncSetUTCSeconds):
+        (JSC::dateProtoFuncSetMinutes):
+        (JSC::dateProtoFuncSetUTCMinutes):
+        (JSC::dateProtoFuncSetHours):
+        (JSC::dateProtoFuncSetUTCHours):
+        (JSC::dateProtoFuncSetDate):
+        (JSC::dateProtoFuncSetUTCDate):
+        (JSC::dateProtoFuncSetMonth):
+        (JSC::dateProtoFuncSetUTCMonth):
+        (JSC::dateProtoFuncSetFullYear):
+        (JSC::dateProtoFuncSetUTCFullYear):
+        (JSC::dateProtoFuncSetYear):
+        * runtime/JSDateMath.cpp:
+        (JSC::localTimeOffset):
+        (JSC::gregorianDateTimeToMS):
+        (JSC::msToGregorianDateTime):
+        (JSC::parseDateFromNullTerminatedCharacters):
+        * runtime/JSDateMath.h:
+        * runtime/VM.h:
+        (JSC::LocalTimeOffsetCache::LocalTimeOffsetCache):
+        (JSC::LocalTimeOffsetCache::reset):
+        Passing TimeType argument to distingush UTC time and local time.
+
</ins><span class="cx"> 2014-08-19  Magnus Granberg  &lt;zorry@gentoo.org&gt;
</span><span class="cx"> 
</span><span class="cx">         TEXTREL in libjavascriptcoregtk-1.0.so.0.11.0 on x86 (or i586)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreJavaScriptCoreorder"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/JavaScriptCore.order (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/JavaScriptCore.order        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/JavaScriptCore.order        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -3210,7 +3210,6 @@
</span><span class="cx"> __ZN3JSCL19formateDateInstanceEPNS_9ExecStateENS_14DateTimeFormatEb
</span><span class="cx"> __ZNK3JSC12DateInstance29calculateGregorianDateTimeUTCEPNS_9ExecStateE
</span><span class="cx"> __ZN3JSC17DateInstanceCache3addEd
</span><del>-__ZN3JSC21msToGregorianDateTimeEPNS_9ExecStateEdbRN3WTF17GregorianDateTimeE
</del><span class="cx"> __ZN3WTF8msToYearEd
</span><span class="cx"> __ZN3WTF11msToMinutesEd
</span><span class="cx"> __ZN3WTF9msToHoursEd
</span><span class="lines">@@ -3286,7 +3285,6 @@
</span><span class="cx"> __ZN3JSC14MacroAssembler20convertInt32ToDoubleENS_22AbstractMacroAssemblerINS_12X86AssemblerEE5Imm32ENS_12X86Registers13XMMRegisterIDE
</span><span class="cx"> __ZN3JSC3JIT15emitSlow_op_modEPNS_11InstructionERPNS_13SlowCaseEntryE
</span><span class="cx"> __ZN3JSCL20dateProtoFuncSetYearEPNS_9ExecStateE
</span><del>-__ZN3JSC21gregorianDateTimeToMSEPNS_9ExecStateERKN3WTF17GregorianDateTimeEdb
</del><span class="cx"> __ZN3WTF18dateToDaysFrom1970Eiii
</span><span class="cx"> __ZN3JSC10PrefixNode11emitBracketERNS_17BytecodeGeneratorEPNS_10RegisterIDE
</span><span class="cx"> __ZN3JSC16globalFuncEscapeEPNS_9ExecStateE
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeDateConstructorcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateConstructor.cpp (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateConstructor.cpp        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateConstructor.cpp        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">             t.setSecond(JSC::toInt32(doubleArguments[5]));
</span><span class="cx">             t.setIsDST(-1);
</span><span class="cx">             double ms = (numArgs &gt;= 7) ? doubleArguments[6] : 0;
</span><del>-            value = gregorianDateTimeToMS(vm, t, ms, false);
</del><ins>+            value = gregorianDateTimeToMS(vm, t, ms, WTF::LocalTime);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     GregorianDateTime ts;
</span><del>-    msToGregorianDateTime(vm, currentTimeMS(), false, ts);
</del><ins>+    msToGregorianDateTime(vm, currentTimeMS(), WTF::LocalTime, ts);
</ins><span class="cx">     return JSValue::encode(jsNontrivialString(&amp;vm, formatDateTime(ts, DateTimeFormatDateAndTime, false)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">     t.setMinute(JSC::toInt32(doubleArguments[4]));
</span><span class="cx">     t.setSecond(JSC::toInt32(doubleArguments[5]));
</span><span class="cx">     double ms = (n &gt;= 7) ? doubleArguments[6] : 0;
</span><del>-    return JSValue::encode(jsNumber(timeClip(gregorianDateTimeToMS(exec-&gt;vm(), t, ms, true))));
</del><ins>+    return JSValue::encode(jsNumber(timeClip(gregorianDateTimeToMS(exec-&gt;vm(), t, ms, WTF::UTCTime))));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeDateInstancecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateInstance.cpp (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateInstance.cpp        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DateInstance.cpp        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">         m_data = vm.dateInstanceCache.add(milli);
</span><span class="cx"> 
</span><span class="cx">     if (m_data-&gt;m_gregorianDateTimeCachedForMS != milli) {
</span><del>-        msToGregorianDateTime(vm, milli, false, m_data-&gt;m_cachedGregorianDateTime);
</del><ins>+        msToGregorianDateTime(vm, milli, WTF::LocalTime, m_data-&gt;m_cachedGregorianDateTime);
</ins><span class="cx">         m_data-&gt;m_gregorianDateTimeCachedForMS = milli;
</span><span class="cx">     }
</span><span class="cx">     return &amp;m_data-&gt;m_cachedGregorianDateTime;
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">         m_data = vm.dateInstanceCache.add(milli);
</span><span class="cx"> 
</span><span class="cx">     if (m_data-&gt;m_gregorianDateTimeUTCCachedForMS != milli) {
</span><del>-        msToGregorianDateTime(vm, milli, true, m_data-&gt;m_cachedGregorianDateTimeUTC);
</del><ins>+        msToGregorianDateTime(vm, milli, WTF::UTCTime, m_data-&gt;m_cachedGregorianDateTimeUTC);
</ins><span class="cx">         m_data-&gt;m_gregorianDateTimeUTCCachedForMS = milli;
</span><span class="cx">     }
</span><span class="cx">     return &amp;m_data-&gt;m_cachedGregorianDateTimeUTC;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeDatePrototypecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DatePrototype.cpp (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DatePrototype.cpp        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/DatePrototype.cpp        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -860,7 +860,7 @@
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static EncodedJSValue setNewValueFromTimeArgs(ExecState* exec, int numArgsToUse, bool inputIsUTC)
</del><ins>+static EncodedJSValue setNewValueFromTimeArgs(ExecState* exec, int numArgsToUse, WTF::TimeType inputTimeType)
</ins><span class="cx"> {
</span><span class="cx">     JSValue thisValue = exec-&gt;hostThisValue();
</span><span class="cx">     if (!thisValue.inherits(DateInstance::info()))
</span><span class="lines">@@ -879,7 +879,7 @@
</span><span class="cx">     double secs = floor(milli / msPerSecond);
</span><span class="cx">     double ms = milli - secs * msPerSecond;
</span><span class="cx"> 
</span><del>-    const GregorianDateTime* other = inputIsUTC 
</del><ins>+    const GregorianDateTime* other = inputTimeType == WTF::UTCTime
</ins><span class="cx">         ? thisDateObj-&gt;gregorianDateTimeUTC(exec)
</span><span class="cx">         : thisDateObj-&gt;gregorianDateTime(exec);
</span><span class="cx">     if (!other)
</span><span class="lines">@@ -893,12 +893,12 @@
</span><span class="cx">         return JSValue::encode(result);
</span><span class="cx">     } 
</span><span class="cx">     
</span><del>-    JSValue result = jsNumber(gregorianDateTimeToMS(vm, gregorianDateTime, ms, inputIsUTC));
</del><ins>+    JSValue result = jsNumber(gregorianDateTimeToMS(vm, gregorianDateTime, ms, inputTimeType));
</ins><span class="cx">     thisDateObj-&gt;setInternalValue(vm, result);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static EncodedJSValue setNewValueFromDateArgs(ExecState* exec, int numArgsToUse, bool inputIsUTC)
</del><ins>+static EncodedJSValue setNewValueFromDateArgs(ExecState* exec, int numArgsToUse, WTF::TimeType inputTimeType)
</ins><span class="cx"> {
</span><span class="cx">     JSValue thisValue = exec-&gt;hostThisValue();
</span><span class="cx">     if (!thisValue.inherits(DateInstance::info()))
</span><span class="lines">@@ -917,10 +917,10 @@
</span><span class="cx"> 
</span><span class="cx">     GregorianDateTime gregorianDateTime; 
</span><span class="cx">     if (numArgsToUse == 3 &amp;&amp; std::isnan(milli)) 
</span><del>-        msToGregorianDateTime(vm, 0, true, gregorianDateTime);
</del><ins>+        msToGregorianDateTime(vm, 0, WTF::UTCTime, gregorianDateTime);
</ins><span class="cx">     else { 
</span><span class="cx">         ms = milli - floor(milli / msPerSecond) * msPerSecond; 
</span><del>-        const GregorianDateTime* other = inputIsUTC 
</del><ins>+        const GregorianDateTime* other = inputTimeType == WTF::UTCTime
</ins><span class="cx">             ? thisDateObj-&gt;gregorianDateTimeUTC(exec)
</span><span class="cx">             : thisDateObj-&gt;gregorianDateTime(exec);
</span><span class="cx">         if (!other)
</span><span class="lines">@@ -934,93 +934,93 @@
</span><span class="cx">         return JSValue::encode(result);
</span><span class="cx">     } 
</span><span class="cx">            
</span><del>-    JSValue result = jsNumber(gregorianDateTimeToMS(vm, gregorianDateTime, ms, inputIsUTC));
</del><ins>+    JSValue result = jsNumber(gregorianDateTimeToMS(vm, gregorianDateTime, ms, inputTimeType));
</ins><span class="cx">     thisDateObj-&gt;setInternalValue(vm, result);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetMilliSeconds(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = false;
-    return setNewValueFromTimeArgs(exec, 1, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::LocalTime;
+    return setNewValueFromTimeArgs(exec, 1, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetUTCMilliseconds(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = true;
-    return setNewValueFromTimeArgs(exec, 1, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::UTCTime;
+    return setNewValueFromTimeArgs(exec, 1, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetSeconds(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = false;
-    return setNewValueFromTimeArgs(exec, 2, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::LocalTime;
+    return setNewValueFromTimeArgs(exec, 2, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetUTCSeconds(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = true;
-    return setNewValueFromTimeArgs(exec, 2, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::UTCTime;
+    return setNewValueFromTimeArgs(exec, 2, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetMinutes(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = false;
-    return setNewValueFromTimeArgs(exec, 3, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::LocalTime;
+    return setNewValueFromTimeArgs(exec, 3, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetUTCMinutes(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = true;
-    return setNewValueFromTimeArgs(exec, 3, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::UTCTime;
+    return setNewValueFromTimeArgs(exec, 3, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetHours(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = false;
-    return setNewValueFromTimeArgs(exec, 4, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::LocalTime;
+    return setNewValueFromTimeArgs(exec, 4, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetUTCHours(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = true;
-    return setNewValueFromTimeArgs(exec, 4, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::UTCTime;
+    return setNewValueFromTimeArgs(exec, 4, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetDate(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = false;
-    return setNewValueFromDateArgs(exec, 1, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::LocalTime;
+    return setNewValueFromDateArgs(exec, 1, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetUTCDate(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = true;
-    return setNewValueFromDateArgs(exec, 1, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::UTCTime;
+    return setNewValueFromDateArgs(exec, 1, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetMonth(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = false;
-    return setNewValueFromDateArgs(exec, 2, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::LocalTime;
+    return setNewValueFromDateArgs(exec, 2, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetUTCMonth(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = true;
-    return setNewValueFromDateArgs(exec, 2, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::UTCTime;
+    return setNewValueFromDateArgs(exec, 2, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetFullYear(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = false;
-    return setNewValueFromDateArgs(exec, 3, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::LocalTime;
+    return setNewValueFromDateArgs(exec, 3, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetUTCFullYear(ExecState* exec)
</span><span class="cx"> {
</span><del>-    const bool inputIsUTC = true;
-    return setNewValueFromDateArgs(exec, 3, inputIsUTC);
</del><ins>+    const WTF::TimeType inputTimeType = WTF::UTCTime;
+    return setNewValueFromDateArgs(exec, 3, inputTimeType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec)
</span><span class="lines">@@ -1044,7 +1044,7 @@
</span><span class="cx">     if (std::isnan(milli))
</span><span class="cx">         // Based on ECMA 262 B.2.5 (setYear)
</span><span class="cx">         // the time must be reset to +0 if it is NaN.
</span><del>-        msToGregorianDateTime(vm, 0, true, gregorianDateTime);
</del><ins>+        msToGregorianDateTime(vm, 0, WTF::UTCTime, gregorianDateTime);
</ins><span class="cx">     else {
</span><span class="cx">         double secs = floor(milli / msPerSecond);
</span><span class="cx">         ms = milli - secs * msPerSecond;
</span><span class="lines">@@ -1060,7 +1060,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     gregorianDateTime.setYear(toInt32((year &gt;= 0 &amp;&amp; year &lt;= 99) ? (year + 1900) : year));
</span><del>-    JSValue result = jsNumber(gregorianDateTimeToMS(vm, gregorianDateTime, ms, false));
</del><ins>+    JSValue result = jsNumber(gregorianDateTimeToMS(vm, gregorianDateTime, ms, WTF::LocalTime));
</ins><span class="cx">     thisDateObj-&gt;setInternalValue(vm, result);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeJSDateMathcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.cpp (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.cpp        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.cpp        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -132,13 +132,14 @@
</span><span class="cx"> // NOTE: The implementation relies on the fact that no time zones have
</span><span class="cx"> // more than one daylight savings offset change per month.
</span><span class="cx"> // If this function is called with NaN it returns NaN.
</span><del>-static LocalTimeOffset localTimeOffset(VM&amp; vm, double ms)
</del><ins>+static LocalTimeOffset localTimeOffset(VM&amp; vm, double ms, WTF::TimeType inputTimeType = WTF::UTCTime)
</ins><span class="cx"> {
</span><span class="cx">     LocalTimeOffsetCache&amp; cache = vm.localTimeOffsetCache;
</span><span class="cx">     double start = cache.start;
</span><span class="cx">     double end = cache.end;
</span><ins>+    WTF::TimeType cachedTimeType = cache.timeType;
</ins><span class="cx"> 
</span><del>-    if (start &lt;= ms) {
</del><ins>+    if (cachedTimeType == inputTimeType &amp;&amp; start &lt;= ms) {
</ins><span class="cx">         // If the time fits in the cached interval, return the cached offset.
</span><span class="cx">         if (ms &lt;= end) return cache.offset;
</span><span class="cx"> 
</span><span class="lines">@@ -146,7 +147,7 @@
</span><span class="cx">         double newEnd = end + cache.increment;
</span><span class="cx"> 
</span><span class="cx">         if (ms &lt;= newEnd) {
</span><del>-            LocalTimeOffset endOffset = calculateLocalTimeOffset(newEnd);
</del><ins>+            LocalTimeOffset endOffset = calculateLocalTimeOffset(newEnd, inputTimeType);
</ins><span class="cx">             if (cache.offset == endOffset) {
</span><span class="cx">                 // If the offset at the end of the new interval still matches
</span><span class="cx">                 // the offset in the cache, we grow the cached time interval
</span><span class="lines">@@ -155,7 +156,7 @@
</span><span class="cx">                 cache.increment = msPerMonth;
</span><span class="cx">                 return endOffset;
</span><span class="cx">             }
</span><del>-            LocalTimeOffset offset = calculateLocalTimeOffset(ms);
</del><ins>+            LocalTimeOffset offset = calculateLocalTimeOffset(ms, inputTimeType);
</ins><span class="cx">             if (offset == endOffset) {
</span><span class="cx">                 // The offset at the given time is equal to the offset at the
</span><span class="cx">                 // new end of the interval, so that means that we've just skipped
</span><span class="lines">@@ -180,31 +181,31 @@
</span><span class="cx">     // Compute the DST offset for the time and shrink the cache interval
</span><span class="cx">     // to only contain the time. This allows fast repeated DST offset
</span><span class="cx">     // computations for the same time.
</span><del>-    LocalTimeOffset offset = calculateLocalTimeOffset(ms);
</del><ins>+    LocalTimeOffset offset = calculateLocalTimeOffset(ms, inputTimeType);
</ins><span class="cx">     cache.offset = offset;
</span><span class="cx">     cache.start = ms;
</span><span class="cx">     cache.end = ms;
</span><span class="cx">     cache.increment = msPerMonth;
</span><ins>+    cache.timeType = inputTimeType;
</ins><span class="cx">     return offset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double gregorianDateTimeToMS(VM&amp; vm, const GregorianDateTime&amp; t, double milliSeconds, bool inputIsUTC)
</del><ins>+double gregorianDateTimeToMS(VM&amp; vm, const GregorianDateTime&amp; t, double milliSeconds, WTF::TimeType inputTimeType)
</ins><span class="cx"> {
</span><span class="cx">     double day = dateToDaysFrom1970(t.year(), t.month(), t.monthDay());
</span><span class="cx">     double ms = timeToMS(t.hour(), t.minute(), t.second(), milliSeconds);
</span><del>-    double result = (day * WTF::msPerDay) + ms;
</del><ins>+    double localTimeResult = (day * WTF::msPerDay) + ms;
+    double localToUTCTimeOffset = inputTimeType == LocalTime
+        ? localTimeOffset(vm, localTimeResult, inputTimeType).offset : 0;
</ins><span class="cx"> 
</span><del>-    if (!inputIsUTC)
-        result -= localTimeOffset(vm, result).offset;
-
-    return result;
</del><ins>+    return localTimeResult - localToUTCTimeOffset;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // input is UTC
</span><del>-void msToGregorianDateTime(VM&amp; vm, double ms, bool outputIsUTC, GregorianDateTime&amp; tm)
</del><ins>+void msToGregorianDateTime(VM&amp; vm, double ms, WTF::TimeType outputTimeType, GregorianDateTime&amp; tm)
</ins><span class="cx"> {
</span><span class="cx">     LocalTimeOffset localTime;
</span><del>-    if (!outputIsUTC) {
</del><ins>+    if (outputTimeType == WTF::LocalTime) {
</ins><span class="cx">         localTime = localTimeOffset(vm, ms);
</span><span class="cx">         ms += localTime.offset;
</span><span class="cx">     }
</span><span class="lines">@@ -226,15 +227,15 @@
</span><span class="cx"> {
</span><span class="cx">     bool haveTZ;
</span><span class="cx">     int offset;
</span><del>-    double ms = WTF::parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset);
-    if (std::isnan(ms))
</del><ins>+    double localTimeMS = WTF::parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset);
+    if (std::isnan(localTimeMS))
</ins><span class="cx">         return QNaN;
</span><span class="cx"> 
</span><del>-    // fall back to local timezone
</del><ins>+    // fall back to local timezone.
</ins><span class="cx">     if (!haveTZ)
</span><del>-        offset = localTimeOffset(vm, ms).offset / WTF::msPerMinute;
</del><ins>+        offset = localTimeOffset(vm, localTimeMS, WTF::LocalTime).offset / WTF::msPerMinute;
</ins><span class="cx"> 
</span><del>-    return ms - (offset * WTF::msPerMinute);
</del><ins>+    return localTimeMS - (offset * WTF::msPerMinute);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double parseDate(VM&amp; vm, const String&amp; date)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeJSDateMathh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.h (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.h        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/JSDateMath.h        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -50,8 +50,8 @@
</span><span class="cx"> 
</span><span class="cx"> class VM;
</span><span class="cx"> 
</span><del>-void msToGregorianDateTime(VM&amp;, double, bool outputIsUTC, GregorianDateTime&amp;);
-double gregorianDateTimeToMS(VM&amp;, const GregorianDateTime&amp;, double, bool inputIsUTC);
</del><ins>+void msToGregorianDateTime(VM&amp;, double, WTF::TimeType outputTimeType, GregorianDateTime&amp;);
+double gregorianDateTimeToMS(VM&amp;, const GregorianDateTime&amp;, double, WTF::TimeType inputTimeType);
</ins><span class="cx"> double getUTCOffset(VM&amp;);
</span><span class="cx"> double parseDateFromNullTerminatedCharacters(VM&amp;, const char* dateString);
</span><span class="cx"> double parseDate(VM&amp;, const WTF::String&amp;);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/VM.h (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/VM.h        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/runtime/VM.h        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -120,6 +120,7 @@
</span><span class="cx">             : start(0.0)
</span><span class="cx">             , end(-1.0)
</span><span class="cx">             , increment(0.0)
</span><ins>+            , timeType(WTF::UTCTime)
</ins><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -129,12 +130,14 @@
</span><span class="cx">             start = 0.0;
</span><span class="cx">             end = -1.0;
</span><span class="cx">             increment = 0.0;
</span><ins>+            timeType = WTF::UTCTime;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         LocalTimeOffset offset;
</span><span class="cx">         double start;
</span><span class="cx">         double end;
</span><span class="cx">         double increment;
</span><ins>+        WTF::TimeType timeType;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     class ConservativeRoots;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-10-22  Byungseon Shin  &lt;sun.shin@lge.com&gt;
+
+        String(new Date(Mar 30 2014 01:00:00)) is wrong in CET
+        https://bugs.webkit.org/show_bug.cgi?id=130967
+
+        Reviewed by Mark Lam.
+
+        By definition of calculateLocalTimeOffset, input time should be UTC time.
+        But there are many cases when input time is based on local time.
+        So, it gives erroneous results while calculating offset of DST boundary time.
+        By adding a argument to distinguish UTC and local time, we can get the correct offset.
+
+        * wtf/DateMath.cpp:
+        (WTF::calculateLocalTimeOffset):
+        (WTF::parseDateFromNullTerminatedCharacters):
+        Compensate time offset depends on UTC time or local time.
+        * wtf/DateMath.h:
+        Add argument to differenciate UTC or local time.
+
</ins><span class="cx"> 2015-01-20  YunQiang Su  &lt;wzssyqa@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix failed to build for Linux/MIPS64EL
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWTFwtfDateMathcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.cpp (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.cpp        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.cpp        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -363,8 +363,6 @@
</span><span class="cx">     return year;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !HAVE(TM_GMTOFF)
-
</del><span class="cx"> static int32_t calculateUTCOffset()
</span><span class="cx"> {
</span><span class="cx"> #if OS(WINDOWS)
</span><span class="lines">@@ -406,6 +404,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !HAVE(TM_GMTOFF)
+
</ins><span class="cx"> #if OS(WINDOWS)
</span><span class="cx"> // Code taken from http://support.microsoft.com/kb/167296
</span><span class="cx"> static void UnixTimeToFileTime(time_t t, LPFILETIME pft)
</span><span class="lines">@@ -467,8 +467,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> // Returns combined offset in millisecond (UTC + DST).
</span><del>-LocalTimeOffset calculateLocalTimeOffset(double ms)
</del><ins>+LocalTimeOffset calculateLocalTimeOffset(double ms, TimeType inputTimeType)
</ins><span class="cx"> {
</span><ins>+#if HAVE(TM_GMTOFF)
+    double localToUTCTimeOffset = inputTimeType == LocalTime ? calculateUTCOffset() : 0;
+#else
+    double localToUTCTimeOffset = calculateUTCOffset();
+#endif
+    if (inputTimeType == LocalTime)
+        ms -= localToUTCTimeOffset;
+
</ins><span class="cx">     // On Mac OS X, the call to localtime (see calculateDSTOffset) will return historically accurate
</span><span class="cx">     // DST information (e.g. New Zealand did not have DST from 1946 to 1974) however the JavaScript
</span><span class="cx">     // standard explicitly dictates that historical information should not be considered when
</span><span class="lines">@@ -498,9 +506,8 @@
</span><span class="cx">     getLocalTime(&amp;localTime, &amp;localTM);
</span><span class="cx">     return LocalTimeOffset(localTM.tm_isdst, localTM.tm_gmtoff * msPerSecond);
</span><span class="cx"> #else
</span><del>-    double utcOffset = calculateUTCOffset();
-    double dstOffset = calculateDSTOffset(localTime, utcOffset);
-    return LocalTimeOffset(dstOffset, utcOffset + dstOffset);
</del><ins>+    double dstOffset = calculateDSTOffset(localTime, localToUTCTimeOffset);
+    return LocalTimeOffset(dstOffset, localToUTCTimeOffset + dstOffset);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1093,7 +1100,7 @@
</span><span class="cx"> 
</span><span class="cx">     // fall back to local timezone
</span><span class="cx">     if (!haveTZ)
</span><del>-        offset = calculateLocalTimeOffset(ms).offset / msPerMinute;
</del><ins>+        offset = calculateLocalTimeOffset(ms, LocalTime).offset / msPerMinute; // ms value is in local time milliseconds.
</ins><span class="cx"> 
</span><span class="cx">     return ms - (offset * msPerMinute);
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWTFwtfDateMathh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.h (184450 => 184451)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.h        2015-05-18 09:40:37 UTC (rev 184450)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/DateMath.h        2015-05-18 10:04:34 UTC (rev 184451)
</span><span class="lines">@@ -53,6 +53,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><ins>+enum TimeType {
+    UTCTime = 0,
+    LocalTime
+};
+
</ins><span class="cx"> struct LocalTimeOffset {
</span><span class="cx">     LocalTimeOffset()
</span><span class="cx">         : isDST(false)
</span><span class="lines">@@ -126,7 +131,7 @@
</span><span class="cx"> WTF_EXPORT_PRIVATE int dayInMonthFromDayInYear(int dayInYear, bool leapYear);
</span><span class="cx"> 
</span><span class="cx"> // Returns combined offset in millisecond (UTC + DST).
</span><del>-WTF_EXPORT_PRIVATE LocalTimeOffset calculateLocalTimeOffset(double utcInMilliseconds);
</del><ins>+WTF_EXPORT_PRIVATE LocalTimeOffset calculateLocalTimeOffset(double utcInMilliseconds, TimeType = UTCTime);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WTF
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>