Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1048)

Unified Diff: Source/core/html/forms/FileInputType.cpp

Issue 235373005: Handle JS-created files in <input type="file">. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed visibility bug. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fileapi/FileList.cpp ('k') | Source/core/rendering/RenderThemeChromiumMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/FileInputType.cpp
diff --git a/Source/core/html/forms/FileInputType.cpp b/Source/core/html/forms/FileInputType.cpp
index 8d95537c599bb9cbd35164d096ad6eb6935ffe31..c344106da44550d1bae998a3cdd71e4246b2e0df 100644
--- a/Source/core/html/forms/FileInputType.cpp
+++ b/Source/core/html/forms/FileInputType.cpp
@@ -89,8 +89,11 @@ FormControlState FileInputType::saveFormControlState() const
FormControlState state;
unsigned numFiles = m_fileList->length();
for (unsigned i = 0; i < numFiles; ++i) {
- state.append(m_fileList->item(i)->path());
- state.append(m_fileList->item(i)->name());
+ if (m_fileList->item(i)->hasBackingFile()) {
+ state.append(m_fileList->item(i)->path());
+ state.append(m_fileList->item(i)->name());
+ }
+ // FIXME: handle Blob-backed File instances, see http://crbug.com/394948
}
return state;
}
@@ -156,7 +159,7 @@ void FileInputType::handleDOMActivateEvent(Event* event)
settings.allowsMultipleFiles = settings.allowsDirectoryUpload || input.fastHasAttribute(multipleAttr);
settings.acceptMIMETypes = input.acceptMIMETypes();
settings.acceptFileExtensions = input.acceptFileExtensions();
- settings.selectedFiles = m_fileList->paths();
+ settings.selectedFiles = m_fileList->pathsForUserVisibleFiles();
settings.useMediaCapture = RuntimeEnabledFeatures::mediaCaptureEnabled() && input.isFileUpload() && input.fastHasAttribute(captureAttr);
chrome->runOpenPanel(input.document().frame(), newFileChooser(settings));
}
« no previous file with comments | « Source/core/fileapi/FileList.cpp ('k') | Source/core/rendering/RenderThemeChromiumMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698