Changeset 150587 in webkit


Ignore:
Timestamp:
May 23, 2013 8:55:18 AM (11 years ago)
Author:
mifenton@rim.com
Message:

[BlackBerry] Validate form data before doing direct submission.
https://bugs.webkit.org/show_bug.cgi?id=116674

Reviewed by Xan Lopez.

PR 314202.

Check validation of the input form before triggering direct submission.

Internally Reviewed by Nima Ghanavatian.

  • WebKitSupport/InputHandler.cpp:

(BlackBerry::WebKit::InputHandler::submitForm):

Location:
trunk/Source/WebKit/blackberry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/ChangeLog

    r150585 r150587  
     12013-05-23  Mike Fenton  <mifenton@rim.com>
     2
     3        [BlackBerry] Validate form data before doing direct submission.
     4        https://bugs.webkit.org/show_bug.cgi?id=116674
     5
     6        Reviewed by Xan Lopez.
     7
     8        PR 314202.
     9
     10        Check validation of the input form before triggering direct submission.
     11
     12        Internally Reviewed by Nima Ghanavatian.
     13
     14        * WebKitSupport/InputHandler.cpp:
     15        (BlackBerry::WebKit::InputHandler::submitForm):
     16
    1172013-05-23  Rob Buis  <rbuis@rim.com>
    218
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

    r150434 r150587  
    10091009
    10101010    InputLog(Platform::LogLevelInfo, "InputHandler::submitForm triggered");
    1011     if (elementType(m_currentFocusElement.get()) == InputTypeTextArea)
     1011
     1012    if (elementType(m_currentFocusElement.get()) != InputTypeTextArea) {
     1013        handleKeyboardInput(Platform::KeyboardEvent(KEYCODE_RETURN, Platform::KeyboardEvent::KeyChar, 0), false /* changeIsPartOfComposition */);
     1014
     1015        // Did this clear the focus? If so, form was submitted or invalid.
     1016        if (!isActiveTextEdit())
     1017            return;
     1018    }
     1019
     1020    // Validate form data and if valid, submit.
     1021    if (formElement->checkValidity())
    10121022        formElement->submit();
    1013     else {
    1014         handleKeyboardInput(Platform::KeyboardEvent(KEYCODE_RETURN, Platform::KeyboardEvent::KeyChar, 0), false /* changeIsPartOfComposition */);
    1015 
    1016         // Confirm that implicit submission was accepted.
    1017         if (isActiveTextEdit())
    1018             formElement->submit();
    1019     }
    10201023}
    10211024
Note: See TracChangeset for help on using the changeset viewer.