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

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

Issue 2462983002: INPUT element: code cleanup (Closed)
Patch Set: Created 4 years, 1 month 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: third_party/WebKit/Source/core/html/forms/FileInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/FileInputType.cpp b/third_party/WebKit/Source/core/html/forms/FileInputType.cpp
index 0d6b38e4894ad3a796b841e0694b8470f3e9aa18..e6f85ffc67cc144c69103e1f5188b9ed3a0a7fed 100644
--- a/third_party/WebKit/Source/core/html/forms/FileInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/FileInputType.cpp
@@ -178,11 +178,9 @@ bool FileInputType::canSetValue(const String& value) {
return value.isEmpty();
}
-bool FileInputType::getTypeSpecificValue(String& value) {
- if (m_fileList->isEmpty()) {
- value = String();
- return true;
- }
+String FileInputType::valueInFilenameValueMode() const {
+ if (m_fileList->isEmpty())
+ return String();
// HTML5 tells us that we're supposed to use this goofy value for
// file input controls. Historically, browsers revealed the real
@@ -190,8 +188,7 @@ bool FileInputType::getTypeSpecificValue(String& value) {
// decided to try to parse the value by looking for backslashes
// (because that's what Windows file paths use). To be compatible
// with that code, we make up a fake path for the file.
- value = "C:\\fakepath\\" + m_fileList->item(0)->name();
- return true;
+ return "C:\\fakepath\\" + m_fileList->item(0)->name();
}
void FileInputType::setValue(const String&,
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/FileInputType.h ('k') | third_party/WebKit/Source/core/html/forms/InputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698