Skip to content
  • tkent@chromium.org's avatar
    HTMLFormElement::checkValidity() returns incorrect result if 'invalid' events are canceled. · ced38641
    tkent@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=52565
    
    Reviewed by Dimitri Glazkov.
    
    Source/WebCore:
    
    * html/HTMLFormElement.cpp:
    (WebCore::HTMLFormElement::validateInteractively):
      Check checkInvalidControlsAndCollectUnhandled() result instead of
      checking emptiness of unhandled invalid controls list.
    (WebCore::HTMLFormElement::checkValidity): ditto.
    (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
      Renamed from collectUnhandledInvalidControls().
      Returns true if there is any invalid control regardless of event canceling.
    * html/HTMLFormElement.h: Rename collectUnhandledInvalidControls() to
      checkInvalidControlsAndCollectUnhandled().
    
    LayoutTests:
    
    Fix tests and results for the behavior change.
    
    * fast/forms/checkValidity-cancel-expected.txt:
    * fast/forms/checkValidity-handler-updates-dom-expected.txt:
    * fast/forms/interactive-validation-cancel-expected.txt:
    * fast/forms/interactive-validation-cancel.html:
    * fast/forms/script-tests/checkValidity-cancel.js:
    * fast/forms/script-tests/checkValidity-handler-updates-dom.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ced38641