2010-02-11 Kent Tamura <tkent@chromium.org>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2010 02:37:19 +0000 (02:37 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2010 02:37:19 +0000 (02:37 +0000)
commitf2bab2d74bb4c2cbbb4037088fdab9a0df56c10a
tree10bc46fa5ee2e21f563296b1d6ad22cad81eab9b
parente20b8981ece270828f41190e79501a8448a57ce0
2010-02-11  Kent Tamura  <tkent@chromium.org>

        Reviewed by Darin Adler.

        Fix two issues on maxLength.
        https://bugs.webkit.org/show_bug.cgi?id=34783

        - Add grapheme test cases
        - Improve test result readability

        * fast/forms/ValidityState-tooLong-input-expected.txt:
        * fast/forms/ValidityState-tooLong-textarea-expected.txt:
        * fast/forms/script-tests/ValidityState-tooLong-input.js:
        * fast/forms/script-tests/ValidityState-tooLong-textarea.js:
2010-02-11  Kent Tamura  <tkent@chromium.org>

        Reviewed by Darin Adler.

        Fix two issues on maxLength.
        https://bugs.webkit.org/show_bug.cgi?id=34783

        - ValidityState.tooLong behavior was inconsistent with UIs of
        <input> and <textarea>. tooLong checked Unicode code point length
        though the UIs checks grapheme cluster length.

        - Setting HTMLTextAreaElement::value didn't update the dirty flag.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::tooLong): Use numGraphemeClusters() instead of length().
        * html/HTMLTextAreaElement.cpp:
          Rename setValue() to setNonDirtyValue(), and introduce setValue()
          which calls setNonDirtyValue() and sets the dirty flag.
        (WebCore::HTMLTextAreaElement::childrenChanged):
        (WebCore::HTMLTextAreaElement::reset):
        (WebCore::HTMLTextAreaElement::setValue):
        (WebCore::HTMLTextAreaElement::setNonDirtyValue):
        (WebCore::HTMLTextAreaElement::setDefaultValue):
        (WebCore::HTMLTextAreaElement::tooLong): Use numGraphemeClusters() instead of length().
        * html/HTMLTextAreaElement.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/ValidityState-tooLong-input-expected.txt
LayoutTests/fast/forms/ValidityState-tooLong-textarea-expected.txt
LayoutTests/fast/forms/script-tests/ValidityState-tooLong-input.js
LayoutTests/fast/forms/script-tests/ValidityState-tooLong-textarea.js
WebCore/ChangeLog
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLTextAreaElement.cpp
WebCore/html/HTMLTextAreaElement.h