2010-02-11 Kent Tamura <tkent@chromium.org>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Feb 2010 08:34:10 +0000 (08:34 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Feb 2010 08:34:10 +0000 (08:34 +0000)
commitedce01c46687b35e6eb161bdb304cdbb64418c2b
tree9d1be6990e5a014e3828d6cee8b2932133ec4a8e
parentc20dd6bc33c73824381cb4ec687c172ef95e2b46
2010-02-11  Kent Tamura  <tkent@chromium.org>

        Reviewed by Darin Adler.

        Step attribute support for date&time types.
        https://bugs.webkit.org/show_bug.cgi?id=30847

        Add tests for ValidityState.stepMismatch, stepUp() and stepDown()
        for date, datetime, datetime-local, month, time, week types.
        Update valueAsDate and valueAsNumber tests for a string representation
        change.

        * fast/forms/ValidityState-stepMismatch-expected.txt: Added.
        * fast/forms/ValidityState-stepMismatch.html: Added.
        * fast/forms/input-stepup-stepdown-expected.txt: Added.
        * fast/forms/input-stepup-stepdown.html: Added.
        * fast/forms/input-valueasdate-datetime-expected.txt:
        * fast/forms/input-valueasdate-time-expected.txt:
        * fast/forms/input-valueasnumber-datetime-expected.txt:
        * fast/forms/input-valueasnumber-datetimelocal-expected.txt:
        * fast/forms/input-valueasnumber-time-expected.txt:
        * fast/forms/script-tests/ValidityState-stepMismatch.js: Added.
        * fast/forms/script-tests/input-stepup-stepdown.js: Added.
        * fast/forms/script-tests/input-valueasdate-datetime.js:
        * fast/forms/script-tests/input-valueasnumber-datetime.js:

2010-02-11  Kent Tamura  <tkent@chromium.org>

        Reviewed by Darin Adler.

        Step attribute support for date&time types.
        https://bugs.webkit.org/show_bug.cgi?id=30847

        - Add implementation for ValidityState.stepMismatch, stepUp() and
          stepDown() for date, datetime, datetime-local, month, time, week types.
        - Fix string representation of DateComponents.

        Tests: fast/forms/ValidityState-stepMismatch.html
               fast/forms/input-stepup-stepdown.html

        * html/HTMLInputElement.cpp:
          - Change monthDefaultMaximum so that DateComponents::m_year doesn't overflow.
        (WebCore::HTMLInputElement::stepBase):
        (WebCore::HTMLInputElement::stepMismatch):
        (WebCore::HTMLInputElement::getStepParameters):
        (WebCore::HTMLInputElement::getAllowedValueStep):
        (WebCore::HTMLInputElement::applyStep):
          Renamed from applyStepForNumberOrRange(), and add support for other types.
        (WebCore::HTMLInputElement::stepUp): Rename applyStepForNumberOrRange().
        (WebCore::HTMLInputElement::stepDown): Rename applyStepForNumberOrRange().
        (WebCore::HTMLInputElement::setValueAsDate): Use setDateValue().
        (WebCore::HTMLInputElement::setDateValue):
          A helper function to make the best representation of DateComponents.
        (WebCore::HTMLInputElement::setValueAsNumber):  Use setDateValue().
        * html/HTMLInputElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@54647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/ValidityState-stepMismatch.html [new file with mode: 0644]
LayoutTests/fast/forms/input-stepup-stepdown-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/input-stepup-stepdown.html [new file with mode: 0644]
LayoutTests/fast/forms/input-valueasdate-datetime-expected.txt
LayoutTests/fast/forms/input-valueasdate-time-expected.txt
LayoutTests/fast/forms/input-valueasnumber-datetime-expected.txt
LayoutTests/fast/forms/input-valueasnumber-datetimelocal-expected.txt
LayoutTests/fast/forms/input-valueasnumber-time-expected.txt
LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js [new file with mode: 0644]
LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js [new file with mode: 0644]
LayoutTests/fast/forms/script-tests/input-valueasdate-datetime.js
LayoutTests/fast/forms/script-tests/input-valueasnumber-datetime.js
WebCore/ChangeLog
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLInputElement.h