According to the current HTML5 spec, UAs have to add filenames for non-multipart form submission. http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#url-encoded-form-data http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#plain-text-form-data > If the entry's type is "file", replace its value with the file's filename only. WebKit sets nothing for type=file at this moment. See HTMLInputElement::appendFormData().
Created attachment 32336 [details] Proposed patch
Comment on attachment 32336 [details] Proposed patch Your ChangeLog has boilerplate code in it. Please read the boilerplate and act on it. This needs an automated test. It's possible to test file drags and file uploads using DumpRenderTree (at least on the mac). Look at creating an http/ test which uses eventSender.beginDragWithFiles() you could also create a new layoutTestController method which did fileObjectForPath() or similar if you wanted to make test which didn't require drag and drop but still used File objects.
Created attachment 32368 [details] Proposed patch (rev.2) Eric, Thank you for the advice. I have updated the ChangeLog, made an automated test, and removed the manual test.
Created attachment 32369 [details] Proposed patch (rev.3) Oops, removed unnecessary JavaScript code.
Comment on attachment 32369 [details] Proposed patch (rev.3) This looks fine to me. Ideally Sam would comment before you land. But I think this is good to go as-is.
Will land.
Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog A LayoutTests/fast/forms/get-file-upload-expected.txt A LayoutTests/fast/forms/get-file-upload.html M WebCore/ChangeLog M WebCore/html/HTMLInputElement.cpp Committed r45987 M WebCore/ChangeLog M WebCore/html/HTMLInputElement.cpp M LayoutTests/ChangeLog A LayoutTests/fast/forms/get-file-upload.html A LayoutTests/fast/forms/get-file-upload-expected.txt r45987 = fd7fd50f8f394c89fe0fd7b59661aff6d249ab9d (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/45987
Re-opening. Tests did not pass on Windows. Reverted in r45999.
In Windows, the console had: CONSOLE MESSAGE: line 29: TypeError: Result of expression 'eventSender.beginDragWithFiles' [undefined] is not a function. FAIL: Timed out waiting for notifyDone to be called Does Windows have no beginDragWithFiles?
I have found other tests with beginDragWithFiles() are disabled for non-Mac.
Created attachment 32914 [details] Proposed patch (rev.4) Disables the test for non-Mac.
Comment on attachment 32914 [details] Proposed patch (rev.4) Thanks for updating the patch.
Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog A LayoutTests/fast/forms/get-file-upload-expected.txt A LayoutTests/fast/forms/get-file-upload.html M LayoutTests/platform/gtk/Skipped M LayoutTests/platform/qt/Skipped M LayoutTests/platform/win/Skipped M WebCore/ChangeLog M WebCore/html/HTMLInputElement.cpp Committed r46006 M WebCore/ChangeLog M WebCore/html/HTMLInputElement.cpp M LayoutTests/platform/qt/Skipped M LayoutTests/platform/gtk/Skipped M LayoutTests/platform/win/Skipped M LayoutTests/ChangeLog A LayoutTests/fast/forms/get-file-upload.html A LayoutTests/fast/forms/get-file-upload-expected.txt r46006 = ba2185d36b7a2858015ae99f9dae0a5b13e62071 (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/46006