Changeset 145362 in webkit


Ignore:
Timestamp:
Mar 11, 2013 7:43:40 AM (11 years ago)
Author:
tkent@chromium.org
Message:

Inappropriate validation message for required number/date input elements
https://bugs.webkit.org/show_bug.cgi?id=111982

Reviewed by Kentaro Hara.

Source/WebCore:

For validation message, badInput messages should take precedence
over valueMissing messages because users already filled out the
field with a bad value.

Tests: Update fast/forms/validationMessage.html

  • html/InputType.cpp:

(WebCore::InputType::validationMessage):
Check badInput first.

LayoutTests:

  • fast/forms/validationMessage-expected.txt:
  • fast/forms/validationMessage.html:
  • platform/chromium/fast/forms/validationMessage-expected.txt:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145356 r145362  
     12013-03-11  Kent Tamura  <tkent@chromium.org>
     2
     3        Inappropriate validation message for required number/date input elements
     4        https://bugs.webkit.org/show_bug.cgi?id=111982
     5
     6        Reviewed by Kentaro Hara.
     7
     8        * fast/forms/validationMessage-expected.txt:
     9        * fast/forms/validationMessage.html:
     10        * platform/chromium/fast/forms/validationMessage-expected.txt:
     11
    1122013-03-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    213
  • trunk/LayoutTests/fast/forms/validationMessage-expected.txt

    r145212 r145362  
    1010input typeMismatch: type mismatch
    1111input badInput: type mismatch
     12badInput and valueMissing:
     13PASS numberInput.validationMessage is nonRequiredBadInputMessage
    1214PASS but.validationMessage is ''
    1315PASS anoninput.validationMessage is ''
  • trunk/LayoutTests/fast/forms/validationMessage.html

    r145212 r145362  
    5656document.execCommand("InsertText", false, "abc");
    5757debug("input badInput: " + numberInput.validationMessage);
     58var nonRequiredBadInputMessage = numberInput.validationMessage;
     59
     60debug("badInput and valueMissing:");
     61numberInput.required = true;
     62shouldBe("numberInput.validationMessage", "nonRequiredBadInputMessage");
    5863
    5964// A button can't be valited and, thus, has a blank validationMessage
  • trunk/LayoutTests/platform/chromium/fast/forms/validationMessage-expected.txt

    r145212 r145362  
    1010input typeMismatch: type mismatch
    1111input badInput: Please enter a number.
     12badInput and valueMissing:
     13PASS numberInput.validationMessage is nonRequiredBadInputMessage
    1214PASS but.validationMessage is ''
    1315PASS anoninput.validationMessage is ''
  • trunk/Source/WebCore/ChangeLog

    r145357 r145362  
     12013-03-11  Kent Tamura  <tkent@chromium.org>
     2
     3        Inappropriate validation message for required number/date input elements
     4        https://bugs.webkit.org/show_bug.cgi?id=111982
     5
     6        Reviewed by Kentaro Hara.
     7
     8        For validation message, badInput messages should take precedence
     9        over valueMissing messages because users already filled out the
     10        field with a bad value.
     11
     12        Tests: Update fast/forms/validationMessage.html
     13
     14        * html/InputType.cpp:
     15        (WebCore::InputType::validationMessage):
     16        Check badInput first.
     17
    1182013-03-11  Yury Semikhatsky  <yurys@chromium.org>
    219
  • trunk/Source/WebCore/html/InputType.cpp

    r145055 r145362  
    375375
    376376    // The order of the following checks is meaningful. e.g. We'd like to show the
    377     // valueMissing message even if the control has other validation errors.
     377    // badInput message even if the control has other validation errors.
     378    if (hasBadInput())
     379        return badInputText();
     380
    378381    if (valueMissing(value))
    379382        return valueMissingText();
     
    381384    if (typeMismatch())
    382385        return typeMismatchText();
    383 
    384     if (hasBadInput())
    385         return badInputText();
    386386
    387387    if (patternMismatch(value))
Note: See TracChangeset for help on using the changeset viewer.