WebCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2004 20:35:41 +0000 (20:35 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2004 20:35:41 +0000 (20:35 +0000)
commit246ca2fea5e97c18e0185e41b75c73e30fcfb95c
tree1bc432ef854924463fe21cd9a80e72dc9d9e317d
parent1d5ac1154438344b69d1ec743f8d87b5e2f2256e
WebCore:

        Reviewed by Chris.

        - did work to prepare for uploading files incrementally when submitting forms

        * khtml/misc/formdata.h: Added. Class for holding form data inside WebCore.
        * khtml/misc/formdata.cpp: Added.

        * khtml/html/html_formimpl.h: Added the FormDataList type, changed the formData function parameters
        and made it private, renamed the encoding method to appendFormData and changed the parameters around.
        * khtml/html/html_formimpl.cpp:
        (DOM::FormDataList): Added. Class that replaces the old use of QValueList<QCString> for form data.
        Later we'll change it to accomodate filenames too.
        (DOM::HTMLFormElementImpl::formData): Changed code to use FormDataList intsead of the old encodingList.
        Also changed to return the "OK" result as the function result and put the form data into something
        passed as an "out" parameter; the old way was the other way around.
        (DOM::HTMLFormElementImpl::submit): Change to use FormData rather than a QByteArray when getting the
        form data to submit.
        (DOM::HTMLButtonElementImpl::appendFormData): Rename from encoding, and use the new appendData function
        instead of the old way of doing += to put data on the list.
        (DOM::HTMLInputElementImpl::appendFormData): Ditto.
        (DOM::HTMLSelectElementImpl::appendFormData): Ditto.
        (DOM::HTMLKeygenElementImpl::appendFormData): Ditto.
        (DOM::HTMLTextAreaElementImpl::appendFormData): Ditto.
        (DOM::FormDataList::FormDataList): Added.
        (DOM::FormDataList::appendString): Added.
        (DOM::FormDataList::begin): Added.
        (DOM::FormDataList::end): Added.

        * khtml/khtml_part.h: Changed the type of the submitForm parameter to FormData instead of QByteArray.
        * khtml/khtmlpart_p.h: Changed the type of the submitFormData data member to FormData instead of QByteArray.
        * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Called the new flattenToString function in all the
        code that handles mailto forms. Called the new flatten function in the non-Apple code path.

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::submitForm): Pass NSArray for form data instead of NSData.

        * kwq/KWQKJob.h: Use FormData instead of QByteArray. A couple other small cleanups.
        * kwq/KWQKJobClasses.h: Ditto.
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate): Ditto.
        (KIO::TransferJob::TransferJob): Ditto.
        (KIO::TransferJob::postData): Ditto.
        * kwq/KWQKPartsBrowserExtension.h: Ditto.
        * kwq/KWQLoader.mm:
        (KWQServeRequest): Ditto.
        (KWQServeSynchronousRequest): Ditto.

        * kwq/KWQFormData.h: Added. A function to convert KHTML form data into an NSArray for communication
        with the WebKit side.
        * kwq/KWQFormData.mm: Added.

        * kwq/WebCoreBridge.h: Pass NSArray instead of NSData for form data.

        * kwq/KWQArrayImpl.h: Added a detach member function. The old version would do unnecessary work when
        detach was called on an array that had exactly one reference.
        * kwq/KWQArrayImpl.mm: (KWQArrayImpl::detach): Added.
        * kwq/KWQMemArray.h: (QMemArray::detach): Call through to KWQArrayImpl.

        * kwq/KWQValueList.h:
        (QValueList::first): Added overload for non-const.
        (QValueList::last): Ditto.

        * ForwardingHeaders/misc/formdata.h: Added.
        * WebCore.pbproj/project.pbxproj: Added formdata.h, formdata.cpp, KWQFormData.h, and KWQFormData.cpp.

        * WebCore-tests.exp: Updated for changes to QValueList, and re-sorted.
        * WebCore-combined.exp: Regenerated.

WebKit:

        Reviewed by Chris.

        - did work to prepare for uploading files incrementally when submitting forms

        * History.subproj/WebHistoryItem.m:
        (-[WebHistoryItem _setFormInfoFromRequest:]): Use NSArray instead of NSData for form data.
        (-[WebHistoryItem formData]): Ditto.
        * History.subproj/WebHistoryItemPrivate.h: Ditto.
        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge startLoadingResource:withURL:customHeaders:postData:]): Ditto.
        (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): Ditto.
        (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Ditto.
        * WebCoreSupport.subproj/WebSubresourceClient.h: Ditto.
        * WebCoreSupport.subproj/WebSubresourceClient.m:
        (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:postData:referrer:forDataSource:]): Ditto.
        * WebView.subproj/WebFrame.m:
        (-[WebFrame _loadItem:withLoadType:]): Ditto.
        (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Ditto.
        * WebView.subproj/WebFramePrivate.h: Ditto.

        * WebView.subproj/WebFormDataStream.h: Added.
        * WebView.subproj/WebFormDataStream.m:
        (-[WebFormDataStream initWithFormDataArray:]): Placeholder; not done yet.
        (-[WebFormDataStream formDataArray]): Ditto.
        * WebKit.pbproj/project.pbxproj: Added WebFormDataStream files.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
38 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/ForwardingHeaders/misc/formdata.h [new file with mode: 0644]
WebCore/WebCore-combined.exp
WebCore/WebCore-tests.exp
WebCore/WebCore.pbproj/project.pbxproj
WebCore/khtml/html/html_formimpl.cpp
WebCore/khtml/html/html_formimpl.h
WebCore/khtml/khtml_part.cpp
WebCore/khtml/khtml_part.h
WebCore/khtml/khtmlpart_p.h
WebCore/khtml/misc/formdata.cpp [new file with mode: 0644]
WebCore/khtml/misc/formdata.h [new file with mode: 0644]
WebCore/kwq/KWQArrayImpl.h
WebCore/kwq/KWQArrayImpl.mm
WebCore/kwq/KWQFormData.h [new file with mode: 0644]
WebCore/kwq/KWQFormData.mm [new file with mode: 0644]
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/KWQKJob.h
WebCore/kwq/KWQKJobClasses.h
WebCore/kwq/KWQKJobClasses.mm
WebCore/kwq/KWQKPartsBrowserExtension.h
WebCore/kwq/KWQLoader.mm
WebCore/kwq/KWQMemArray.h
WebCore/kwq/KWQValueList.h
WebCore/kwq/WebCoreBridge.h
WebKit/ChangeLog
WebKit/History.subproj/WebHistoryItem.m
WebKit/History.subproj/WebHistoryItemPrivate.h
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
WebKit/WebKit.pbproj/project.pbxproj
WebKit/WebView.subproj/WebFormDataStream.h [new file with mode: 0644]
WebKit/WebView.subproj/WebFormDataStream.m [new file with mode: 0644]
WebKit/WebView.subproj/WebFrame.m
WebKit/WebView.subproj/WebFramePrivate.h