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

Side by Side Diff: Source/core/html/forms/FileInputType.cpp

Issue 364503002: Revert of node.cloneNode() should clone the value of file upload elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/forms/FileInputType.h ('k') | Source/core/html/forms/InputType.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 filesChosen(firstFileOnly); 353 filesChosen(firstFileOnly);
354 } 354 }
355 return true; 355 return true;
356 } 356 }
357 357
358 String FileInputType::droppedFileSystemId() 358 String FileInputType::droppedFileSystemId()
359 { 359 {
360 return m_droppedFileSystemId; 360 return m_droppedFileSystemId;
361 } 361 }
362 362
363 void FileInputType::copyNonAttributeProperties(const HTMLInputElement& sourceEle ment)
364 {
365 RefPtrWillBeRawPtr<FileList> fileList(FileList::create());
366 FileList* sourceFileList = sourceElement.files();
367 unsigned size = sourceFileList->length();
368 for (unsigned i = 0; i < size; ++i) {
369 File* file = sourceFileList->item(i);
370 fileList->append(File::createWithRelativePath(file->path(), file->webkit RelativePath()));
371 }
372 setFiles(fileList.release());
373 }
374
375 String FileInputType::defaultToolTip() const 363 String FileInputType::defaultToolTip() const
376 { 364 {
377 FileList* fileList = m_fileList.get(); 365 FileList* fileList = m_fileList.get();
378 unsigned listSize = fileList->length(); 366 unsigned listSize = fileList->length();
379 if (!listSize) { 367 if (!listSize) {
380 return locale().queryString(WebLocalizedString::FileButtonNoFileSelected Label); 368 return locale().queryString(WebLocalizedString::FileButtonNoFileSelected Label);
381 } 369 }
382 370
383 StringBuilder names; 371 StringBuilder names;
384 for (size_t i = 0; i < listSize; ++i) { 372 for (size_t i = 0; i < listSize; ++i) {
385 names.append(fileList->item(i)->name()); 373 names.append(fileList->item(i)->name());
386 if (i != listSize - 1) 374 if (i != listSize - 1)
387 names.append('\n'); 375 names.append('\n');
388 } 376 }
389 return names.toString(); 377 return names.toString();
390 } 378 }
391 379
392 } // namespace WebCore 380 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/FileInputType.h ('k') | Source/core/html/forms/InputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698