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

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

Issue 267713006: node.cloneNode() should clone the value of file upload elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 7 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
Index: Source/core/html/forms/FileInputType.cpp
diff --git a/Source/core/html/forms/FileInputType.cpp b/Source/core/html/forms/FileInputType.cpp
index 2fbd187fe9f51f9b7b297f30372ee804a9904432..bfe8515a50cc45ee5669633de17388bd250fe0a0 100644
--- a/Source/core/html/forms/FileInputType.cpp
+++ b/Source/core/html/forms/FileInputType.cpp
@@ -360,6 +360,17 @@ String FileInputType::droppedFileSystemId()
return m_droppedFileSystemId;
}
+void FileInputType::copyFiles(PassRefPtrWillBeRawPtr<FileList> files)
+{
+ RefPtrWillBeRawPtr<FileList> fileList(FileList::create());
+ unsigned size = files->length();
+ for (unsigned i = 0; i < size; ++i) {
+ File* file = files->item(i);
+ fileList->append(File::createWithRelativePath(file->path(), file->webkitRelativePath()));
+ }
+ setFiles(fileList.release());
+}
+
String FileInputType::defaultToolTip() const
{
FileList* fileList = m_fileList.get();

Powered by Google App Engine
This is Rietveld 408576698