Add form delegate method that's invoked right before sending a submit event to a...
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Apr 2013 22:28:34 +0000 (22:28 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Apr 2013 22:28:34 +0000 (22:28 +0000)
commita71bc7ec9f7e08e7db5be7eaab25323ffabf79d1
tree1405c7ec154aa1a66d12067736157c68e4f852bc
parent6029ae66efd053da75d85d108437300916563a84
Add form delegate method that's invoked right before sending a submit event to a form element
https://bugs.webkit.org/show_bug.cgi?id=114575

Reviewed by Dan Bernstein.

Source/WebCore:

* WebCore.exp.in:
Export a symbol.

* WebCore.xcodeproj/project.pbxproj:
Make DOMHTMLFormElementInternal.h a private header.

Source/WebKit/mac:

* MigrateHeaders.make:
Copy DOMHTMLFormElementInternal.h over to WebKit.

* WebCoreSupport/WebFrameLoaderClient.mm:
(makeFormFieldValuesDictionary):
New helper function that returns the values of a form in dictionary form.

(WebFrameLoaderClient::dispatchWillSendSubmitEvent):
Call the right delegate method.

(WebFrameLoaderClient::dispatchWillSubmitForm):
Use the helper function.

* WebView/WebDelegateImplementationCaching.h:
* WebView/WebDelegateImplementationCaching.mm:
(CallFormDelegate):
Add another overload.

* WebView/WebFormDelegate.h:
* WebView/WebFormDelegate.m:
(-[WebFormDelegate willSendSubmitEventToForm:inFrame:withValues:]):
Add a default implementation.

Tools:

Add a test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm: Added.
(-[FormDelegate willSendSubmitEventToForm:inFrame:withValues:]):
(TestWebKitAPI):
(TestWebKitAPI::TEST):

* TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
(TestWebKitAPI::Util::toSTD):
Don't crash when a null NSString is passed to toSTD.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/MigrateHeaders.make
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebDelegateImplementationCaching.h
Source/WebKit/mac/WebView/WebDelegateImplementationCaching.mm
Source/WebKit/mac/WebView/WebFormDelegate.h
Source/WebKit/mac/WebView/WebFormDelegate.m
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm [new file with mode: 0644]
Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm