Bug 94100 - Calendar picker shows wrong date when input element has year earlier than 100
Summary: Calendar picker shows wrong date when input element has year earlier than 100
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keishi Hattori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-15 06:18 PDT by Keishi Hattori
Modified: 2012-08-17 19:52 PDT (History)
2 users (show)

See Also:


Attachments
Patch (30.43 KB, patch)
2012-08-15 06:42 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Patch (30.41 KB, patch)
2012-08-15 19:05 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Patch (7.54 KB, patch)
2012-08-16 05:28 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Patch (6.83 KB, patch)
2012-08-17 05:05 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keishi Hattori 2012-08-15 06:18:32 PDT
Date.UTC can't set an year earlier than 1900. So when the input has a value earlier than 1900, calendar picker shows the wrong date.
Comment 1 Keishi Hattori 2012-08-15 06:42:03 PDT
Created attachment 158561 [details]
Patch
Comment 2 Kent Tamura 2012-08-15 18:33:17 PDT
Comment on attachment 158561 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=158561&action=review

> Source/WebCore/ChangeLog:8
> +        Date.UTC can't set an year earlier than 1900. So when the input has a value earlier than 1900, calendar picker shows the wrong date.

Date.UTC() seems to work expectedly if year >= 100, not 1900.
Comment 3 Keishi Hattori 2012-08-15 19:05:16 PDT
Created attachment 158688 [details]
Patch
Comment 4 Kent Tamura 2012-08-15 20:21:19 PDT
Comment on attachment 158688 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=158688&action=review

> LayoutTests/ChangeLog:10
> +        * platform/chromium-mac/fast/forms/date/calendar-picker-appearance-pre-100-expected.png: Added.

Adding a pixel test for this issue is not reasonable.
Can we make this a dumpAsText test?  I think the test code can access JavaScript code in a page popup.

> LayoutTests/fast/forms/date/calendar-picker-appearance-pre-100.html:16
> +console.log('Check if year before 1900 can be set.');

1900 -> 100
Comment 5 Keishi Hattori 2012-08-16 05:28:59 PDT
Created attachment 158783 [details]
Patch
Comment 6 Kent Tamura 2012-08-16 06:36:57 PDT
Comment on attachment 158783 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=158783&action=review

> LayoutTests/fast/forms/date/calendar-picker-appearance-pre-100-expected.txt:9
> +TEST COMPLETE
> +PASS document.getElementById("date").value is "0002-02-03"

"TEST COMPLETE" followed by the PASS looks wrong.

You need to use jsTestIsAsync=true & finishJSTest() if you use js-test-post.js, or need to remove js-test-post.js.

> LayoutTests/platform/chromium/TestExpectations:2494
> +BUGWK92710 : fast/forms/date/calendar-picker-appearance-pre-100.html = IMAGE PASS

We don't need it.
Comment 7 Keishi Hattori 2012-08-17 05:05:16 PDT
Created attachment 159092 [details]
Patch
Comment 8 WebKit Review Bot 2012-08-17 19:52:03 PDT
Comment on attachment 159092 [details]
Patch

Clearing flags on attachment: 159092

Committed r125962: <http://trac.webkit.org/changeset/125962>
Comment 9 WebKit Review Bot 2012-08-17 19:52:07 PDT
All reviewed patches have been landed.  Closing bug.