DevHeads.net

Review Request 118947: KJS: treat specified time correctly as localtime when passed to the Date() constructor

Review request for kdelibs.

Bugs: 335556
<a href="http://bugs.kde.org/show_bug.cgi?id=335556" title="http://bugs.kde.org/show_bug.cgi?id=335556">http://bugs.kde.org/show_bug.cgi?id=335556</a>

Repository: kdelibs

Description
The commit <a href="https://projects.kde.org/projects/kde/kdelibs/repository/revisions/48dd1fc50277b861b49613c5f46b6f8b10cc932d" title="https://projects.kde.org/projects/kde/kdelibs/repository/revisions/48dd1fc50277b861b49613c5f46b6f8b10cc932d">https://projects.kde.org/projects/kde/kdelibs/repository/revisions/48dd1...</a> introduced a bug:
It factors out the code to convert a time specification to an actual time value into the function makeTimeFromList().
But in that function makeTime(&t, ms, true) is called, whereas the original code called makeTime(&t, ms, false) for the constructor.

This patch fixes it by passing the "utc" parameter to makeTime() instead of "true".

Please note that this bug is also present in Frameworks5.

Diffs
kjs/date_object.cpp c8d776c

Diff: <a href="https://git.reviewboard.kde.org/r/118947/diff/" title="https://git.reviewboard.kde.org/r/118947/diff/">https://git.reviewboard.kde.org/r/118947/diff/</a>

Testing
Loaded the test case from the bug report into Konqueror/KHTML. The correct time is shown now like in other browsers, including Konqueror/WebKit.

Thanks,

Wolfgang Bauer

Comments

Re: Review Request 118947: KJS: treat specified time correctly a

By Wolfgang Bauer at 06/26/2014 - 08:03

(Updated June 26, 2014, 12:03 p.m.)

Status
This change has been marked as submitted.

Review request for kdelibs.

Bugs: 335556
<a href="http://bugs.kde.org/show_bug.cgi?id=335556" title="http://bugs.kde.org/show_bug.cgi?id=335556">http://bugs.kde.org/show_bug.cgi?id=335556</a>

Repository: kdelibs

Description
The commit <a href="https://projects.kde.org/projects/kde/kdelibs/repository/revisions/48dd1fc50277b861b49613c5f46b6f8b10cc932d" title="https://projects.kde.org/projects/kde/kdelibs/repository/revisions/48dd1fc50277b861b49613c5f46b6f8b10cc932d">https://projects.kde.org/projects/kde/kdelibs/repository/revisions/48dd1...</a> introduced a bug:
It factors out the code to convert a time specification to an actual time value into the function makeTimeFromList().
But in that function makeTime(&t, ms, true) is called, whereas the original code called makeTime(&t, ms, false) for the constructor.

This patch fixes it by passing the "utc" parameter to makeTime() instead of "true".

Please note that this bug is also present in Frameworks5.

Diffs
kjs/date_object.cpp c8d776c

Diff: <a href="https://git.reviewboard.kde.org/r/118947/diff/" title="https://git.reviewboard.kde.org/r/118947/diff/">https://git.reviewboard.kde.org/r/118947/diff/</a>

Testing
Loaded the test case from the bug report into Konqueror/KHTML. The correct time is shown now like in other browsers, including Konqueror/WebKit.

Thanks,

Wolfgang Bauer

Re: Review Request 118947: KJS: treat specified time correctly a

By =?UTF-8?Q?Nicol... at 07/16/2014 - 10:27

Was this forward-ported to khtml frameworks?

- Nicolás Alvarez

On Jun. 26, 2014, 9:03 a.m., Wolfgang Bauer wrote:

Re: Review Request 118947: KJS: treat specified time correctly a

By Bernd Buschinski at 07/16/2014 - 10:31

No, it was forward-ported to kjs framework, kjs is not a part of khtml

- Bernd

On Juni 26, 2014, 12:03 nachm., Wolfgang Bauer wrote:

Re: Review Request 118947: KJS: treat specified time correctly a

By Commit Hook at 06/26/2014 - 08:25

This review has been submitted with commit 198c1819e382aed93a574c6f9d51c7303985a672 by Wolfgang Bauer to branch master.

- Commit Hook

On June 26, 2014, 12:03 p.m., Wolfgang Bauer wrote:

Re: Review Request 118947: KJS: treat specified time correctly a

By Commit Hook at 06/26/2014 - 08:18

This review has been submitted with commit 786e0a7821f195c5a227e72a41d29033851dc2af by Wolfgang Bauer to branch master.

- Commit Hook

On June 26, 2014, 12:03 p.m., Wolfgang Bauer wrote:

Re: Review Request 118947: KJS: treat specified time correctly a

By Commit Hook at 06/26/2014 - 08:03

This review has been submitted with commit 0137c691cfe02e6fc0c99e2ced15aea149e56b4b by Wolfgang Bauer to branch KDE/4.13.

- Commit Hook

On June 26, 2014, 10:41 a.m., Wolfgang Bauer wrote:

Re: Review Request 118947: KJS: treat specified time correctly a

By Bernd Buschinski at 06/26/2014 - 07:17

Ship it!

Good catch!
Bug by me, I passed the correct utc value to makeTimeFromList but never passed it to makeTime (where it should go), so the fix is 100% correct.

- Bernd Buschinski

On June 26, 2014, 10:41 a.m., Wolfgang Bauer wrote: