Bug 1162658 - Update FormData to match latest spec, r=smaug
This commit is contained in:
@@ -5572,14 +5572,14 @@ HTMLInputElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
const nsTArray<RefPtr<File>>& files = GetFilesInternal();
|
||||
|
||||
for (uint32_t i = 0; i < files.Length(); ++i) {
|
||||
aFormSubmission->AddNameFilePair(name, files[i]);
|
||||
aFormSubmission->AddNameBlobPair(name, files[i]);
|
||||
}
|
||||
|
||||
if (files.IsEmpty()) {
|
||||
RefPtr<BlobImpl> blobImpl =
|
||||
new BlobImplEmptyFile(NS_LITERAL_STRING("application/octet-stream"));
|
||||
RefPtr<File> file = File::Create(OwnerDoc()->GetInnerWindow(), blobImpl);
|
||||
aFormSubmission->AddNameFilePair(name, file);
|
||||
new EmptyBlobImpl(NS_LITERAL_STRING("application/octet-stream"));
|
||||
RefPtr<Blob> blob = Blob::Create(OwnerDoc()->GetInnerWindow(), blobImpl);
|
||||
aFormSubmission->AddNameBlobPair(name, blob);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
Reference in New Issue
Block a user