WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 83011
Add JavaScript and CSS code for the calendar picker implementation
https://bugs.webkit.org/show_bug.cgi?id=83011
Summary
Add JavaScript and CSS code for the calendar picker implementation
Kent Tamura
Reported
2012-04-03 02:33:07 PDT
Add JavaScript and CSS code for the calendar picker implementation
Attachments
Patch
(43.47 KB, patch)
2012-04-03 03:53 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Patch 2
(44.15 KB, patch)
2012-04-03 19:09 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Patch 3
(44.93 KB, patch)
2012-04-04 20:27 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Patch 4
(45.49 KB, patch)
2012-04-04 23:22 PDT
,
Kent Tamura
morrita
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Kent Tamura
Comment 1
2012-04-03 03:53:40 PDT
Created
attachment 135302
[details]
Patch
Kent Tamura
Comment 2
2012-04-03 19:09:46 PDT
Created
attachment 135486
[details]
Patch 2 Code cleanup
Kent Tamura
Comment 3
2012-04-03 19:16:16 PDT
Hattori-san, would you do informal review for the patch please?
Kent Tamura
Comment 4
2012-04-03 19:19:15 PDT
Comment on
attachment 135486
[details]
Patch 2 View in context:
https://bugs.webkit.org/attachment.cgi?id=135486&action=review
> Source/WebCore/ChangeLog:8 > + Add calendarPicker.js and calendarPicker.css, and a buld rule to
oops, and a buld rule -> and add a build rule
> Source/WebCore/ChangeLog:9 > + generte a C++ file. This change doesn't make any behavior change
generte -> generate
Keishi Hattori
Comment 5
2012-04-04 03:49:42 PDT
Comment on
attachment 135486
[details]
Patch 2 View in context:
https://bugs.webkit.org/attachment.cgi?id=135486&action=review
> Source/WebCore/Resources/calendarPicker.css:97 > +}
Is this used?
> Source/WebCore/Resources/calendarPicker.js:36 > +var Class = {
Inspector code would use something plural like ClassNames.
> Source/WebCore/Resources/calendarPicker.js:37 > + Available: 'available',
Inspector code uses double quotes for all strings.
> Source/WebCore/Resources/calendarPicker.js:656 > + * @param {boolean} right false:left, true:right
this param doesn't exist anymore.
> Source/WebCore/Resources/calendarPicker.js:693 > + if (this._lastY > 0 && this._x > 0)
this._lastY should be this._y The next line too.
> Source/WebCore/Resources/calendarPicker.js:775 > + node.classList.add(Class.Selected);
I found it strange that the selected date of the DaysTable doesn't match the node with the day-selected class. I also think that it would be useful to show the current value inside the calendar. Maybe there should be a selected date that is the value and a separate highlighted date for mouse hover.
> Source/WebCore/Resources/calendarPicker.js:863 > + } else if (dayNode.classList.contains(Class.UnavailableUp)) {
Class.UnavailableUp and Class.UnavailableDown are never added to any node.
> Source/WebCore/Resources/calendarPicker.js:930 > + global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PREVIOUS_MONTH : YearMonthController.NEXT_MONTH);
Wrong names. _moveRelatively YearMonthController._PreviousMonth YearMonthController._NextMonth
> Source/WebCore/Resources/calendarPicker.js:932 > + global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PREVIOUS_YEAR : YearMonthController.NEXT_YEAR);
_moveRelatively YearMonthController._NextYear YearMonthController._PreviousYear
> Source/WebCore/Resources/calendarPicker.js:934 > + global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PREVIOUS_10YEARS : YearMonthController.NEXT_10YEARS);
_moveRelatively YearMonthController._PreviousTenYears YearMonthController._NextTenYears
> ManualTests/forms/calendar-picker.html:53 > +var japaneseArguments = {
Is this used?
Kent Tamura
Comment 6
2012-04-04 20:21:46 PDT
Comment on
attachment 135486
[details]
Patch 2 View in context:
https://bugs.webkit.org/attachment.cgi?id=135486&action=review
Thank you for reviewing the long code.
>> Source/WebCore/Resources/calendarPicker.css:97 >> +} > > Is this used?
Deleted.
>> Source/WebCore/Resources/calendarPicker.js:36 >> +var Class = { > > Inspector code would use something plural like ClassNames.
Renamed to ClassNames.
>> Source/WebCore/Resources/calendarPicker.js:37 >> + Available: 'available', > > Inspector code uses double quotes for all strings.
Replaced ' with ".
>> Source/WebCore/Resources/calendarPicker.js:656 >> + * @param {boolean} right false:left, true:right > > this param doesn't exist anymore.
Right. Deleted.
>> Source/WebCore/Resources/calendarPicker.js:693 >> + if (this._lastY > 0 && this._x > 0) > > this._lastY should be this._y > The next line too.
Fixed.
>> Source/WebCore/Resources/calendarPicker.js:775 >> + node.classList.add(Class.Selected); > > I found it strange that the selected date of the DaysTable doesn't match the node with the day-selected class. > I also think that it would be useful to show the current value inside the calendar. > > Maybe there should be a selected date that is the value > and a separate highlighted date for mouse hover.
I don't like to change the UI behavior at this moment because Chrome UX/UI team agreed about the current behavior. Let's change the behavior if we have a lot of complain.
>> Source/WebCore/Resources/calendarPicker.js:863 >> + } else if (dayNode.classList.contains(Class.UnavailableUp)) { > > Class.UnavailableUp and Class.UnavailableDown are never added to any node.
Removed related code.
>> Source/WebCore/Resources/calendarPicker.js:930 >> + global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PREVIOUS_MONTH : YearMonthController.NEXT_MONTH); > > Wrong names. > _moveRelatively > YearMonthController._PreviousMonth > YearMonthController._NextMonth
Fixed. They should be public.
>> Source/WebCore/Resources/calendarPicker.js:932 >> + global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PREVIOUS_YEAR : YearMonthController.NEXT_YEAR); > > _moveRelatively > YearMonthController._NextYear > YearMonthController._PreviousYear
ditto.
>> Source/WebCore/Resources/calendarPicker.js:934 >> + global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PREVIOUS_10YEARS : YearMonthController.NEXT_10YEARS); > > _moveRelatively > YearMonthController._PreviousTenYears > YearMonthController._NextTenYears
ditto.
>> ManualTests/forms/calendar-picker.html:53 >> +var japaneseArguments = { > > Is this used?
This is not used, but it's useful for l10n test. I'd like to keep this.
Kent Tamura
Comment 7
2012-04-04 20:27:21 PDT
Created
attachment 135750
[details]
Patch 3 Addressed the comments.
Keishi Hattori
Comment 8
2012-04-04 21:37:15 PDT
Comment on
attachment 135750
[details]
Patch 3 View in context:
https://bugs.webkit.org/attachment.cgi?id=135750&action=review
Also I noticed that you can't use up/down arrow keys inside of the month popup.
> Source/WebCore/Resources/calendarPicker.js:206 > + return yearString + "-" + ("0" + (month + 1)).substr(-2, 2) + "-" + ("0" + day).substr(-2, 2)
Missing semicolon.
> Source/WebCore/Resources/calendarPicker.js:390 > + this._wall.addEventListener("click", bind(this._closePopup, this), false);
Maybe you can use blur event to remove this wall element? this._monthPopup.addEventListener("blur", bind(this._closePopup, this), false);
Kent Tamura
Comment 9
2012-04-04 23:22:54 PDT
Created
attachment 135762
[details]
Patch 4 Keyboard operation for the month popup
Kent Tamura
Comment 10
2012-04-04 23:24:28 PDT
(In reply to
comment #8
)
> (From update of
attachment 135750
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=135750&action=review
> > Also I noticed that you can't use up/down arrow keys inside of the month popup.
Fixed.
> > Source/WebCore/Resources/calendarPicker.js:206 > > + return yearString + "-" + ("0" + (month + 1)).substr(-2, 2) + "-" + ("0" + day).substr(-2, 2) > > Missing semicolon.
Fixed.
> > Source/WebCore/Resources/calendarPicker.js:390 > > + this._wall.addEventListener("click", bind(this._closePopup, this), false); > > Maybe you can use blur event to remove this wall element? > this._monthPopup.addEventListener("blur", bind(this._closePopup, this), false);
It's not sufficient. I'd like to disallow DaysArea hover and click actions during opening the month popup.
Keishi Hattori
Comment 11
2012-04-05 00:01:11 PDT
I think its ok now.
Hajime Morrita
Comment 12
2012-04-05 00:26:58 PDT
Comment on
attachment 135762
[details]
Patch 4 kinda stamping. Let us land this and see how it works.
Kent Tamura
Comment 13
2012-04-05 00:27:56 PDT
Thank you!!
Kent Tamura
Comment 14
2012-04-05 00:31:06 PDT
Committed
r113298
: <
http://trac.webkit.org/changeset/113298
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug