Patch for JDK-8090098 - [regression] Webview - getTimezoneOffset() of a ISO strings returns a wrong value
Anton Tarasov
anton.tarasov at oracle.com
Mon Jun 29 18:42:50 UTC 2015
Hi Steve,
Ok, I'll investigate it.
Thanks,
Anton.
On 29.06.2015 18:39, Hruda, Steve wrote:
>
> Hi Anton & Kevin,
>
> we read your comments in the JDK bug system and analyzed WebKit's
> changesets again.
>
> We’ve found the code which made this regression.
>
> http://trac.webkit.org/changeset/159892
>
> This changeset doesn't handle one special case, which was handled by
> the previous code....
>
> double diff = ((localSystemTime.wHour - offsetHour) * secondsPerHour)
> + ((localSystemTime.wMinute - offsetMinute) *60);
>
>
> (http://trac.webkit.org/browser/trunk/Source/WTF/wtf/DateMath.cpp?annotate=blame#L481
> )
>
> The diff is wrong if the calculated the offsetTime is one day before
> in case of the extreme values (e.g. midnight) where the offsetHour of
> the UTC time is 23 because of the day difference.
>
> In case of all other OS systems you will see the same code ->
> http://trac.webkit.org/browser/trunk/Source/WTF/wtf/DateMath.cpp?annotate=blame#L495
>
> But there are two additional lines -> 497 & 497 which fixes this
> special case…
>
> *if*(diff<0)
>
> diff += secondsPerDay;
>
>
> That means ….
>
> localSystemTime.wHour = 0;
>
> offsetHour=23 … which causes a negative value … and the
> diff+=secondsPerDay ensures that the diff result would be one Hour
> instead of -23 hours
>
> We’ve found the attached V8DateTests.js (renamed to .txt) and adjusted
> it a little bit to get the results logged in the browsers console.
>
> As you can see at “ResulBeforeOurBugFix.txt” and
> “ResultAfterOurBugFix.txt”, we were able to fix 6 tests which failed
> before out bug fix.
>
> assertEquals("Sat Oct 25 2014 23:00:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 9, 25, 23, 0)).toString());
>
> assertEquals("Sat, 25 Oct 2014 21:00:00 GMT",
>
> (new Date(2014, 9, 25, 23, 0)).toUTCString());
>
> assertEquals("Sat Oct 25 2014 23:59:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 9, 25, 23, 59)).toString());
>
> assertEquals("Sat, 25 Oct 2014 21:59:00 GMT",
>
> (new Date(2014, 9, 25, 23, 59)).toUTCString());
>
> assertEquals("Sun Oct 26 2014 00:00:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 9, 26, 0, 0)).toString());
>
> assertEquals("Sun Oct 26 2014 00:59:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 9, 26, 0, 59)).toString());
>
> In addition we found out that WebKit also have problems in case of
> Windows in case of the change from winter to summer time.
>
> *_Winter to summer time:_*
>
> assertEquals("Sun Mar 30 2014 03:00:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 2, 30, 2, 0)).toString());
>
> assertEquals("Sun, 30 Mar 2014 01:00:00 GMT",
>
> (new Date(2014, 2, 30, 2, 0)).toUTCString());
>
> assertEquals("Sun Mar 30 2014 03:59:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 2, 30, 2, 59)).toString());
>
> assertEquals("Sun, 30 Mar 2014 01:59:00 GMT",
>
> (new Date(2014, 2, 30, 2, 59)).toUTCString());
>
> *_Summer to winter time:_*
>
> assertEquals("Sun Oct 26 2014 02:00:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 9, 26, 2, 0)).toString());
>
> assertEquals("Sun, 26 Oct 2014 00:00:00 GMT",
>
> (new Date(2014, 9, 26, 2, 0)).toUTCString());
>
> assertEquals("Sun Oct 26 2014 02:59:00 GMT+0200 (W. Europe Daylight
> Time)",
>
> (new Date(2014, 9, 26, 2, 59)).toString());
>
> assertEquals("Sun, 26 Oct 2014 00:59:00 GMT",
>
> (new Date(2014, 9, 26, 2, 59)).toUTCString());
>
> We will try to find a solution for that, but I think that the priority
> of this issue is lower than the priority of the opened regression.
>
> It would be amazing if you can add the patch of my previous and these
> additional two lines (DateMath.cpp) to the JDK8u60.
>
> Best Regards,
>
> Steve
>
>
> Diese E-Mail wurde versandt im Auftrag des Unternehmens Intergraph
> Ges.m.b.H.
> Vertretungsberechtigte Geschäftsführer: Maximilian Weber
> Sitz der Gesellschaft: Margaretenstraße 70/I/1, 1050 Wien, Österreich,
> Tel. +43 (1) 9610567-0
> Eingetragen beim Handelsgericht Wien, Firmenbuch-Nr.: FN 116859 b
> Umsatzsteuer-Identifikationsnummer / VAT-ID: ATU15138401,
> Steuer-Nummer: 264/4807
>
> This E-Mail has been sent on behalf of the company Intergraph Ges.m.b.H.
> Authorised Managing Directors: Maximilian Weber
> Registered office and Austrian headquarters: Margaretenstr. 70/I/1,
> 1050 Wien, Austria, Tel. +43 (1) 9610567-0
> The company is recorded at the commercial court of Vienna under the
> company register number FN 116859 b
> VAT-ID: ATU15138401, Austrian Tax ID: 264/4807
>
> Diese E-Mail (mit zugehörigen Dateien) enthält möglicherweise
> Informationen, die vertraulich sind, dem Urheberrecht unterliegen oder
> ein Geschäftsgeheimnis darstellen. Falls Sie diese Nachricht
> irrtümlicherweise erhalten haben, benachrichtigen Sie uns bitte
> umgehend, indem Sie eine Antwort senden, und löschen Sie bitte diese
> E-Mail und Ihre Antwort darauf. Sämtliche aufgeführten Ansichten oder
> Meinungen sind ausschließlich diejenigen des Autors und entsprechen
> nicht notwendigerweise denen des Unternehmens Intergraph.
>
> This E-Mail (and any attachments) may be confidential and protected by
> legal privilege. If you are not the intended recipient please notify
> us immediately by replying to the sender and delete this E-Mail and
> your reply from your system. All the views and opinions published here
> are solely based on the author's own opinion and should not be
> considered necessarily as reflecting the opinion of Intergraph.
>
> -----Original Message-----
>
> From: openjfx-dev [mailto:openjfx-dev-bounces at openjdk.java.net] On
> Behalf Of Hruda, Steve
>
> Sent: Tuesday, June 23, 2015 6:26 PM
>
> To: Anton V. Tarasov; Kevin Rushforth
>
> Cc: openjfx-dev at openjdk.java.net
>
> Subject: RE: Patch for JDK-8090098 - [regression] Webview -
> getTimezoneOffset() of a ISO strings returns a wrong value
>
> Very cool Anton.
>
> I would be great if that pach could be added to 8u60, otherwise our
> all our customers have to avoid Java 8u60.
>
> Regards,
>
> Steve
>
> Diese E-Mail wurde versandt im Auftrag des Unternehmens Intergraph
> Ges.m.b.H.
>
> Vertretungsberechtigte Geschäftsführer: Maximilian Weber Sitz der
> Gesellschaft: Margaretenstraße 70/I/1, 1050 Wien, Österreich, Tel. +43
> (1) 9610567-0 Eingetragen beim Handelsgericht Wien, Firmenbuch-Nr.: FN
> 116859 b Umsatzsteuer-Identifikationsnummer / VAT-ID: ATU15138401,
> Steuer-Nummer: 264/4807
>
> This E-Mail has been sent on behalf of the company Intergraph Ges.m.b.H.
>
> Authorised Managing Directors: Maximilian Weber Registered office and
> Austrian headquarters: Margaretenstr. 70/I/1, 1050 Wien, Austria, Tel.
> +43 (1) 9610567-0 The company is recorded at the commercial court of
> Vienna under the company register number FN 116859 b
>
> VAT-ID: ATU15138401, Austrian Tax ID: 264/4807
>
> Diese E-Mail (mit zugehörigen Dateien) enthält möglicherweise
> Informationen, die vertraulich sind, dem Urheberrecht unterliegen oder
> ein Geschäftsgeheimnis darstellen. Falls Sie diese Nachricht
> irrtümlicherweise erhalten haben, benachrichtigen Sie uns bitte
> umgehend, indem Sie eine Antwort senden, und löschen Sie bitte diese
> E-Mail und Ihre Antwort darauf. Sämtliche aufgeführten Ansichten oder
> Meinungen sind ausschließlich diejenigen des Autors und entsprechen
> nicht notwendigerweise denen des Unternehmens Intergraph.
>
> This E-Mail (and any attachments) may be confidential and protected by
> legal privilege. If you are not the intended recipient please notify
> us immediately by replying to the sender and delete this E-Mail and
> your reply from your system. All the views and opinions published here
> are solely based on the author's own opinion and should not be
> considered necessarily as reflecting the opinion of Intergraph.
>
> -----Original Message-----
>
> From: Anton V. Tarasov [mailto:anton.tarasov at oracle.com]
>
> Sent: Tuesday, June 23, 2015 5:46 PM
>
> To: Kevin Rushforth; Hruda, Steve
>
> Cc: openjfx-dev at openjdk.java.net
>
> Subject: Re: Patch for JDK-8090098 - [regression] Webview -
> getTimezoneOffset() of a ISO strings returns a wrong value
>
> On 23.06.2015 17:48, Kevin Rushforth wrote:
>
> > Hi Steve,
>
> >
>
> > Thank you for taking the time to create this patch. I will add this information to
> the bug report.
>
> >
>
> > Since your OCA is in progress we will take a look at your patch, but
>
> > will need indication from the OCA office that it the OCA has been
>
> > received before we could push it. And just to be clear, you won't have
>
> > access to the repository even with an OCA. What the OCA will do is allow you to
> contribute patches.
>
> >
>
> > I will note that it is likely too late for 8u60, but Anton can
>
> > evaluate it and post his comment in the bug report.
>
> Kevin,
>
> I'm checking it.
>
> Steve, thanks for the participation!
>
> Regards,
>
> Anton.
>
> >
>
> > -- Kevin
>
> >
>
> >
>
> > Hruda, Steve wrote:
>
> >> Hi,
>
> >> I've created a 8u-dev patch for the following WeKit regression which comes with 8u60.
>
> >>https://bugs.openjdk.java.net/browse/JDK-8090098
>
> >>
>
> >> Please can someone of you apply this patch to fix the
>
> >> getTimezoneOffset() issue. I have no access to the repository -> my
> OCA is still pending.
>
> >>
>
> >> In addition I tried to test this patch , but I wasn't able to build
>
> >> the necessary jfxwebkit.dll on my windows system
>
> >> (https://www.mail-archive.com/openjfx-dev@openjdk.java.net/msg09439.h
>
> >> tml )..... but I got no compile erros on Mac.
>
> >>
>
> >> Patch download:
>
> >>https://drive.google.com/file/d/0B7P_rknS1TWxM3BSTTU2OVZ4dGM/view?usp
>
> >> =sharing
>
> >>
>
> >> The patch includes the following WebKit fixes:
>
> >> Changeset 174377 - [Win] DateMath's calculateUTFOffset does not account for DST.
>
> >>http://trac.webkit.org/changeset/174377
>
> >>
>
> >> Changeset 175078 - String(new Date(Mar 30 2014 01:00:00)) is wrong
>
> >> in CET
>
> >>http://trac.webkit.org/changeset/175078
>
> >>
>
> >> Changeset 181360 - [Win] 17 different JSC tests started to fail in
>
> >> DST
>
> >>http://trac.webkit.org/changeset/181360
>
> >>
>
> >> Please let me know if you need further information.
>
> >>
>
> >> Thanks in advance!
>
> >> Best Regards
>
> >> Steve
>
> >>
>
> >>
>
> >>
>
> >> Diese E-Mail wurde versandt im Auftrag des Unternehmens Intergraph
> Ges.m.b.H.
>
> >> Vertretungsberechtigte Geschäftsführer: Maximilian Weber Sitz der
>
> >> Gesellschaft: Margaretenstraße 70/I/1, 1050 Wien, Österreich, Tel.
>
> >> +43 (1) 9610567-0 Eingetragen beim Handelsgericht Wien,
>
> >> Firmenbuch-Nr.: FN 116859 b Umsatzsteuer-Identifikationsnummer /
>
> >> VAT-ID: ATU15138401, Steuer-Nummer: 264/4807
>
> >>
>
> >> This E-Mail has been sent on behalf of the company Intergraph Ges.m.b.H.
>
> >> Authorised Managing Directors: Maximilian Weber Registered office and
>
> >> Austrian headquarters: Margaretenstr. 70/I/1, 1050 Wien, Austria,
>
> >> Tel. +43
>
> >> (1) 9610567-0
>
> >> The company is recorded at the commercial court of Vienna under the
>
> >> company register number FN
>
> >> 116859 b
>
> >> VAT-ID: ATU15138401, Austrian Tax ID: 264/4807
>
> >>
>
> >> Diese E-Mail (mit zugehörigen Dateien) enthält möglicherweise
>
> >> Informationen, die vertraulich sind, dem Urheberrecht unterliegen
>
> >> oder ein Geschäftsgeheimnis darstellen. Falls Sie diese Nachricht
>
> >> irrtümlicherweise erhalten haben, benachrichtigen Sie uns bitte
>
> >> umgehend, indem Sie eine Antwort senden, und löschen Sie bitte diese
>
> >> E-Mail und Ihre Antwort darauf. Sämtliche aufgeführten Ansichten
> oder Meinungen sind ausschließlich diejenigen des Autors und
> entsprechen nicht notwendigerweise denen des Unternehmens Intergraph.
>
> >>
>
> >> This E-Mail (and any attachments) may be confidential and protected
>
> >> by legal privilege. If you are not the intended recipient please
>
> >> notify us immediately by replying to the sender and delete this
>
> >> E-Mail and your reply from your system. All the views and opinions
>
> >> published here are solely based on the author's own opinion and should not be
> considered necessarily as reflecting the opinion of Intergraph.
>
> >>
>
> >>
>
More information about the openjfx-dev
mailing list