INPUT_MULTIPLE_FIELDS_UI: Step-up/-down of week field should respect min/max attributes
https://bugs.webkit.org/show_bug.cgi?id=106416
Patch by Kunihiko Sakamoto <ksakamoto@chromium.org> on 2013-01-09
Reviewed by Kent Tamura.
Source/WebCore:
Make step-up/-down of the week field respect the min/max attributes of the element.
Note that it still accepts any keyboard inputs (the element
becomes 'invalid' state when out-of-range values entered).
Tests: fast/forms/week-multiple-fields/week-multiple-fields-readonly-subfield.html
fast/forms/week-multiple-fields/week-multiple-fields-stepup-stepdown-from-renderer.html
* css/html.css: Add a CSS rule for week field.
* html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditBuilder::visitField):
Compute minimum/maximum values of week field from the min/max parameters of the element.
* html/shadow/DateTimeFieldElements.cpp:
(WebCore::DateTimeWeekFieldElement::DateTimeWeekFieldElement): Add mininum/maximum arguments.
(WebCore::DateTimeWeekFieldElement::create): Ditto.
(WebCore::DateTimeWeekFieldElement::clampValueForHardLimits): Added.
* html/shadow/DateTimeFieldElements.h:
(DateTimeWeekFieldElement): Add mininum/maximum arguments and declare clampValueForHardLimits.
LayoutTests:
* fast/forms/week-multiple-fields/week-multiple-fields-readonly-subfield-expected.txt: Added.
* fast/forms/week-multiple-fields/week-multiple-fields-readonly-subfield.html: Added.
* fast/forms/week-multiple-fields/week-multiple-fields-stepup-stepdown-from-renderer-expected.txt: Added.
* fast/forms/week-multiple-fields/week-multiple-fields-stepup-stepdown-from-renderer.html: Added.
git-svn-id: svn://svn.chromium.org/blink/trunk@139172 bbb929c8-8fbe-4397-9dbb-9b2b20218538
10 files changed