Title: [150587] trunk/Source/WebKit/blackberry
- Revision
- 150587
- Author
- [email protected]
- Date
- 2013-05-23 08:55:18 -0700 (Thu, 23 May 2013)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/ChangeLog (150586 => 150587)
--- trunk/Source/WebKit/blackberry/ChangeLog 2013-05-23 15:20:13 UTC (rev 150586)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2013-05-23 15:55:18 UTC (rev 150587)
@@ -1,3 +1,19 @@
+2013-05-23 Mike Fenton <[email protected]>
+
+ [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):
+
2013-05-23 Rob Buis <[email protected]>
[BlackBerry] Properly fill the ResourceError in FrameLoaderClientBlackBerry::cannotShowURLError
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (150586 => 150587)
--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp 2013-05-23 15:20:13 UTC (rev 150586)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp 2013-05-23 15:55:18 UTC (rev 150587)
@@ -1008,15 +1008,18 @@
return;
InputLog(Platform::LogLevelInfo, "InputHandler::submitForm triggered");
- if (elementType(m_currentFocusElement.get()) == InputTypeTextArea)
- formElement->submit();
- else {
+
+ if (elementType(m_currentFocusElement.get()) != InputTypeTextArea) {
handleKeyboardInput(Platform::KeyboardEvent(KEYCODE_RETURN, Platform::KeyboardEvent::KeyChar, 0), false /* changeIsPartOfComposition */);
- // Confirm that implicit submission was accepted.
- if (isActiveTextEdit())
- formElement->submit();
+ // Did this clear the focus? If so, form was submitted or invalid.
+ if (!isActiveTextEdit())
+ return;
}
+
+ // Validate form data and if valid, submit.
+ if (formElement->checkValidity())
+ formElement->submit();
}
static void addInputStyleMaskForKeyboardType(int64_t& inputMask, VirtualKeyboardType keyboardType)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes