Bug 110454

Summary: Add methods to date types for new calendar picker
Product: WebKit Reporter: Keishi Hattori <keishi>
Component: FormsAssignee: Keishi Hattori <keishi>
Status: RESOLVED FIXED    
Severity: Normal CC: tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 109439    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Keishi Hattori 2013-02-21 03:41:22 PST
Add methods to date types for new calendar picker
Comment 1 Keishi Hattori 2013-02-21 03:58:48 PST
Created attachment 189505 [details]
Patch
Comment 2 Kent Tamura 2013-02-21 06:49:16 PST
Comment on attachment 189505 [details]
Patch

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

> Source/WebCore/Resources/pagepopups/calendarPicker.js:224
>      this.year = dateObject.getUTCFullYear();    
>      this.month = dateObject.getUTCMonth();
>      this.date = dateObject.getUTCDate();

Data members should have JsDoc comments in the constructor.

> Source/WebCore/Resources/pagepopups/calendarPicker.js:249
> + * @param {!number} value
> + * @return {!Day}
> + */
> +Day.createFromValue = function(value) {

'value' has almost no information.   It should be 'milliseconds' or something.

> Source/WebCore/Resources/pagepopups/calendarPicker.js:268
> +    return day.copy();

Can we just return this?
AFAIK, Day objects are immutable, right?

> Source/WebCore/Resources/pagepopups/calendarPicker.js:332
> +    return this.copy();

Ditto.

> Source/WebCore/Resources/pagepopups/calendarPicker.js:339
> +    return this.copy();

Ditto.

> Source/WebCore/Resources/pagepopups/calendarPicker.js:346
> +    return this.copy();

Ditto.

> Source/WebCore/Resources/pagepopups/calendarPicker.js:389
> +    this.year = year;
> +    this.week = week;

Data members should have JsDoc comments in the constructor.

> Source/WebCore/Resources/pagepopups/calendarPicker.js:487
> +        return Day.Minimum.copy();

Do we need to copy?

> Source/WebCore/Resources/pagepopups/calendarPicker.js:616
> +    this.year = year + Math.floor(month / MonthsPerYear);
> +    this.month = month % MonthsPerYear < 0 ? month % MonthsPerYear + MonthsPerYear : month % MonthsPerYear;

Data members should have JsDoc comments in the constructor.

> Source/WebCore/Resources/pagepopups/calendarPicker.js:642
> + * @param {!number} value

Need more meaningful name.  monthsSinceEpoch?

> Source/WebCore/Resources/pagepopups/calendarPicker.js:752
> +        return Day.Maximum.copy();

Do we need to copy?
Comment 3 Keishi Hattori 2013-02-21 20:32:59 PST
Created attachment 189667 [details]
Patch
Comment 4 Kent Tamura 2013-02-21 23:03:05 PST
Comment on attachment 189667 [details]
Patch

ok
Comment 5 Keishi Hattori 2013-02-22 03:34:40 PST
Created attachment 189735 [details]
Patch
Comment 6 WebKit Review Bot 2013-02-22 05:23:10 PST
Comment on attachment 189735 [details]
Patch

Rejecting attachment 189735 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=gce-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 189735, '--port=chromium-xvfb']" exit_code: 2 cwd: /mnt/git/webkit-commit-queue

Last 500 characters of output:

fatal: read error: Connection reset by peer
Died at Tools/Scripts/update-webkit line 151.

Failed to run "['Tools/Scripts/update-webkit', '--chromium', '--force-update']" exit_code: 2

Updating OpenSource
fatal: read error: Connection reset by peer
Died at Tools/Scripts/update-webkit line 151.

Failed to run "['Tools/Scripts/update-webkit', '--chromium', '--force-update']" exit_code: 2
Updating OpenSource
fatal: read error: Connection reset by peer
Died at Tools/Scripts/update-webkit line 151.

Full output: http://queues.webkit.org/results/16700795
Comment 7 WebKit Review Bot 2013-02-24 08:44:30 PST
Comment on attachment 189735 [details]
Patch

Clearing flags on attachment: 189735

Committed r143867: <http://trac.webkit.org/changeset/143867>
Comment 8 WebKit Review Bot 2013-02-24 08:44:33 PST
All reviewed patches have been landed.  Closing bug.