Changeset 135110 in webkit


Ignore:
Timestamp:
Nov 18, 2012 9:50:44 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

min/max/step support for calendar picker on datetime/datetime-local
https://bugs.webkit.org/show_bug.cgi?id=102628

Patch by Kunihiko Sakamoto <ksakamoto@chromium.org> on 2012-11-18
Reviewed by Kent Tamura.

Source/WebCore:

Gray out dates with no allowed values on calendar picker for datetime/datetime-local
when values are limited by min/max/step attributes.

Test: platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-with-step.html

  • Resources/pagepopups/calendarPicker.js:

(CalendarPicker.prototype._stepMismatch):
Returns true iff there are any allowed values in the given day.

LayoutTests:

Verify that calendar picker has correct available dates when
min/max/step attributes are set in datetime input.

  • platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-with-step-expected.txt: Added.
  • platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-with-step.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r135105 r135110  
     12012-11-18  Kunihiko Sakamoto  <ksakamoto@chromium.org>
     2
     3        min/max/step support for calendar picker on datetime/datetime-local
     4        https://bugs.webkit.org/show_bug.cgi?id=102628
     5
     6        Reviewed by Kent Tamura.
     7
     8        Verify that calendar picker has correct available dates when
     9        min/max/step attributes are set in datetime input.
     10
     11        * platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-with-step-expected.txt: Added.
     12        * platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-with-step.html: Added.
     13
    1142012-11-18  Kentaro Hara  <haraken@chromium.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r135109 r135110  
     12012-11-18  Kunihiko Sakamoto  <ksakamoto@chromium.org>
     2
     3        min/max/step support for calendar picker on datetime/datetime-local
     4        https://bugs.webkit.org/show_bug.cgi?id=102628
     5
     6        Reviewed by Kent Tamura.
     7
     8        Gray out dates with no allowed values on calendar picker for datetime/datetime-local
     9        when values are limited by min/max/step attributes.
     10
     11        Test: platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-with-step.html
     12
     13        * Resources/pagepopups/calendarPicker.js:
     14        (CalendarPicker.prototype._stepMismatch):
     15        Returns true iff there are any allowed values in the given day.
     16
    1172012-11-18  Laszlo Gombos  <l.gombos@samsung.com>
    218
  • trunk/Source/WebCore/Resources/pagepopups/calendarPicker.js

    r134753 r135110  
    12201220 */
    12211221CalendarPicker.prototype._stepMismatch = function(value) {
    1222     return (value - this.stepBase) % this.step != 0;
     1222    var nextAllowedValue = Math.ceil((value - this.stepBase) / this.step) * this.step + this.stepBase;
     1223    return nextAllowedValue >= value + this.selectionConstructor.DefaultStep
    12231224}
    12241225
Note: See TracChangeset for help on using the changeset viewer.