Bug 111778 - Empty file input is submitted incorrectly
Summary: Empty file input is submitted incorrectly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-07 15:04 PST by Alexey Proskuryakov
Modified: 2013-03-07 15:04 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2013-03-07 15:04:52 PST
When we are submitting an <input type=file> that does not have a file in it, we (correctly) send an empty file. But we do with two mistakes:

1) We create a File with an empty path, which is invalid. We should be using some other way to achieve this, such as perhaps an empty Blob.

2) The File is destroyed before the form is actually submitted, so BlobRegistry has to deal with an unregistered blob URL. The File is owned by DOMFormData, and that's destroyed at the end of FormSubmission::create(). So, a Blob or a File becomes unregistered in blob registry, and cannot be used when actually building form data stream in another process.

We should obviously keep uploaded objects alive while form submission takes place.

See also: bug 111687.