2010-12-13 Dai Mikurube <dmikurube@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Dec 2010 05:19:30 +0000 (05:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Dec 2010 05:19:30 +0000 (05:19 +0000)
commite661a00ec5e28ae4443a389f35660a05b2a5975a
treed6dc247ac35c4a1c2755d1219caaad43435bd4e2
parent8ba7b7d83848eb3699ac6e37b6ce00b07f4f247c
2010-12-13  Dai Mikurube  <dmikurube@google.com>

        Reviewed by Kent Tamura.

        ValidityState's exposed functions should check if willValidate() is true before all
        https://bugs.webkit.org/show_bug.cgi?id=50617

        * fast/css/pseudo-required-optional-005-expected.txt:
        * fast/css/pseudo-required-optional-005.html:
        * fast/css/pseudo-valid-001-expected.txt:
        * fast/css/pseudo-valid-001.html:
        * fast/css/pseudo-valid-unapplied-expected.txt:
        * fast/css/pseudo-valid-unapplied.html:
        * fast/forms/ValidityState-customError.html:
        * fast/forms/ValidityState-customError-expected.txt:
        * fast/forms/ValidityState-customError.html:
        * fast/forms/ValidityState-patternMismatch-expected.txt:
        * fast/forms/ValidityState-patternMismatch.html:
        * fast/forms/ValidityState-rangeOverflow-expected.txt:
        * fast/forms/ValidityState-rangeUnderflow-expected.txt:
        * fast/forms/ValidityState-stepMismatch-expected.txt:
        * fast/forms/ValidityState-tooLong-input-expected.txt:
        * fast/forms/ValidityState-tooLong-textarea-expected.txt:
        * fast/forms/ValidityState-typeMismatch-color-expected.txt:
        * fast/forms/ValidityState-typeMismatch-date-expected.txt:
        * fast/forms/ValidityState-typeMismatch-datetime-expected.txt:
        * fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt:
        * fast/forms/ValidityState-typeMismatch-month-expected.txt:
        * fast/forms/ValidityState-typeMismatch-number-expected.txt:
        * fast/forms/ValidityState-typeMismatch-time-expected.txt:
        * fast/forms/ValidityState-typeMismatch-url-expected.txt:
        * fast/forms/ValidityState-typeMismatch-week-expected.txt:
        * fast/forms/script-tests/ValidityState-rangeOverflow.js:
        (checkOverflow):
        (checkNotOverflow):
        * fast/forms/script-tests/ValidityState-rangeUnderflow.js:
        (checkUnderflow):
        (checkNotUnderflow):
        * fast/forms/script-tests/ValidityState-stepMismatch.js:
        (stepMismatchFor):
        * fast/forms/script-tests/ValidityState-tooLong-input.js:
        * fast/forms/script-tests/ValidityState-tooLong-textarea.js:
        * fast/forms/script-tests/ValidityState-typeMismatch-color.js:
        ():
        * fast/forms/script-tests/ValidityState-typeMismatch-date.js:
        ():
        (shouldBeValid):
        (shouldBeInvalid):
        * fast/forms/script-tests/ValidityState-typeMismatch-datetime.js:
        ():
        (shouldBeValid):
        (shouldBeInvalid):
        * fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js:
        ():
        (shouldBeValid):
        (shouldBeInvalid):
        * fast/forms/script-tests/ValidityState-typeMismatch-month.js:
        ():
        (shouldBeValid):
        (shouldBeInvalid):
        * fast/forms/script-tests/ValidityState-typeMismatch-number.js:
        ():
        * fast/forms/script-tests/ValidityState-typeMismatch-time.js:
        ():
        (shouldBeValid):
        (shouldBeInvalid):
        * fast/forms/script-tests/ValidityState-typeMismatch-url.js:
        (check):
        (expectValid):
        (expectInvalid):
        * fast/forms/script-tests/ValidityState-typeMismatch-week.js:
        ():
        (shouldBeValid):
        (shouldBeInvalid):
        * fast/forms/script-tests/willvalidate.js:
        * fast/forms/willvalidate-expected.txt:
2010-12-13  Dai Mikurube  <dmikurube@google.com>

        Reviewed by Kent Tamura.

        ValidityState's exposed functions should check if willValidate() is true before all
        https://bugs.webkit.org/show_bug.cgi?id=50617

        Added checking willValidate() to exposed functions. And modified willValidate() behavior
        for <button type="submit"> and <input type="submit"> to return true if not disabled and
        not readonly.

        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::parseMappedAttribute): Added calling setNeedsWillValidateCheck() to refresh willValidate() after changing its type.
        (WebCore::HTMLButtonElement::recalcWillValidate): Added to return true if not disabled and not readonly when type="submit". It's to be compliant to the spec.
        * html/HTMLButtonElement.h:
        * html/SubmitInputType.cpp:
        (WebCore::SubmitInputType::supportsValidation): Removed it to enable willValidate() for <input> when type="submit". It's to be compliant to the spec.
        (WebCore::SubmitInputType::supportsRequired): Added it to reject required attributes though validation is available.
        * html/SubmitInputType.h:
        * html/ValidityState.cpp: Added checking willValidate().
        (WebCore::ValidityState::typeMismatch):
        (WebCore::ValidityState::patternMismatch):
        (WebCore::ValidityState::tooLong):
        (WebCore::ValidityState::rangeUnderflow):
        (WebCore::ValidityState::rangeOverflow):
        (WebCore::ValidityState::stepMismatch):
        (WebCore::ValidityState::customError):
        * html/ValidityState.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
48 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/pseudo-required-optional-005-expected.txt
LayoutTests/fast/css/pseudo-required-optional-005.html
LayoutTests/fast/css/pseudo-valid-001-expected.txt
LayoutTests/fast/css/pseudo-valid-001.html
LayoutTests/fast/css/pseudo-valid-unapplied-expected.txt
LayoutTests/fast/css/pseudo-valid-unapplied.html
LayoutTests/fast/forms/ValidityState-customError-expected.txt
LayoutTests/fast/forms/ValidityState-customError.html
LayoutTests/fast/forms/ValidityState-patternMismatch-expected.txt
LayoutTests/fast/forms/ValidityState-patternMismatch.html
LayoutTests/fast/forms/ValidityState-rangeOverflow-expected.txt
LayoutTests/fast/forms/ValidityState-rangeUnderflow-expected.txt
LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
LayoutTests/fast/forms/ValidityState-tooLong-input-expected.txt
LayoutTests/fast/forms/ValidityState-tooLong-textarea-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-color-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-date-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-datetime-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-month-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-number-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-time-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-url-expected.txt
LayoutTests/fast/forms/ValidityState-typeMismatch-week-expected.txt
LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js
LayoutTests/fast/forms/script-tests/ValidityState-rangeUnderflow.js
LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
LayoutTests/fast/forms/script-tests/ValidityState-tooLong-input.js
LayoutTests/fast/forms/script-tests/ValidityState-tooLong-textarea.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-color.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-date.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-datetime.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-month.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-number.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-time.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-url.js
LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-week.js
LayoutTests/fast/forms/script-tests/willvalidate.js
LayoutTests/fast/forms/willvalidate-expected.txt
WebCore/ChangeLog
WebCore/html/HTMLButtonElement.cpp
WebCore/html/HTMLButtonElement.h
WebCore/html/SubmitInputType.cpp
WebCore/html/SubmitInputType.h
WebCore/html/ValidityState.cpp
WebCore/html/ValidityState.h