Changeset 66343 in webkit
- Timestamp:
- Aug 29, 2010 6:16:15 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66340 r66343 1 2010-08-29 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Implement HTML5's fakepath 6 https://bugs.webkit.org/show_bug.cgi?id=29000 7 8 Update expectations for this pasteboard test to include our new friend 9 fakepath. 10 11 * editing/pasteboard/file-input-files-access-expected.txt: 12 1 13 2010-08-29 Mihai Parparita <mihaip@chromium.org> 2 14 -
trunk/LayoutTests/editing/pasteboard/file-input-files-access-expected.txt
r59689 r66343 5 5 6 6 Dragging a single (non-existant) file to a file input control: 7 PASS fileInput.value is "DRTFakeFile" 7 FAIL fileInput.value should be DRTFakeFile. Was C:\fakepath\DRTFakeFile. 8 8 PASS fileInput.files.length is 1 9 9 PASS fileInput.files[0].name is "DRTFakeFile" … … 13 13 PASS fileInput.files[0].fileSize is 0 14 14 Dragging a real file to a file input control: 15 PASS fileInput.value is "apple.gif" 15 FAIL fileInput.value should be apple.gif. Was C:\fakepath\apple.gif. 16 16 PASS fileInput.files.length is 1 17 17 PASS fileInput.files[0].name is "apple.gif" … … 21 21 PASS fileInput.files[0].fileSize is 1476 22 22 Dragging a directory onto an file input control: 23 FAIL fileInput.value should be . Was directory-for-dragging.23 FAIL fileInput.value should be . Was C:\fakepath\directory-for-dragging. 24 24 FAIL fileInput.files.length should be 0. Was 1. 25 25 FIXME: Single-file input elements should refuse multi-file drags. See https://bugs.webkit.org/show_bug.cgi?id=25913 26 26 Dragging two files to a single-file input control: 27 FAIL fileInput.value should be . Was apple.gif.27 FAIL fileInput.value should be . Was C:\fakepath\apple.gif. 28 28 FAIL fileInput.files.length should be 0. Was 1. 29 29 Dragging a file and a directory onto a single-file input control: 30 FAIL fileInput.value should be . Was apple.gif.30 FAIL fileInput.value should be . Was C:\fakepath\apple.gif. 31 31 FAIL fileInput.files.length should be 0. Was 1. 32 32 FIXME: elements should refuse drags including directories: https://bugs.webkit.org/show_bug.cgi?id=25879. The page is given File objects corresponding to directories, but form submission will fail. 33 33 Dragging a directory and a file onto a single-file input control: 34 FAIL fileInput.value should be . Was directory-for-dragging.34 FAIL fileInput.value should be . Was C:\fakepath\directory-for-dragging. 35 35 FAIL fileInput.files.length should be 0. Was 1. 36 36 Dragging two files to a multi-file input control: 37 PASS fileInput.value is "apple.gif" 37 FAIL fileInput.value should be apple.gif. Was C:\fakepath\apple.gif. 38 38 PASS fileInput.files.length is 2 39 39 PASS fileInput.files[0].name is "apple.gif" … … 48 48 PASS fileInput.files[1].fileSize is 2593 49 49 Dragging a file and a directory onto a mutli-file input control: 50 FAIL fileInput.value should be . Was apple.gif.50 FAIL fileInput.value should be . Was C:\fakepath\apple.gif. 51 51 FAIL fileInput.files.length should be 0. Was 2. 52 52 FIXME: elements should refuse drags including directories: https://bugs.webkit.org/show_bug.cgi?id=25879. The page is given File objects corresponding to directories, but form submission will fail. 53 53 Dragging a directory and a file onto a mutli-file input control: 54 FAIL fileInput.value should be . Was directory-for-dragging.54 FAIL fileInput.value should be . Was C:\fakepath\directory-for-dragging. 55 55 FAIL fileInput.files.length should be 0. Was 2. 56 56 Dragging to a disabled file input control: -
trunk/WebCore/ChangeLog
r66342 r66343 1 2010-08-29 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Implement HTML5's fakepath 6 https://bugs.webkit.org/show_bug.cgi?id=29000 7 8 The HTML 5 spec says to prepend C:\fakepath\ to the value of an 9 <input type="file"> control, so that's what we do now. 10 11 * html/HTMLInputElement.cpp: 12 (WebCore::HTMLInputElement::value): 13 1 14 2010-08-29 Sheriff Bot <webkit.review.bot@gmail.com> 2 15 -
trunk/WebCore/html/HTMLInputElement.cpp
r66223 r66343 1499 1499 String HTMLInputElement::value() const 1500 1500 { 1501 // The HTML5 spec (as of the 10/24/08 working draft) says that the value attribute isn't applicable to the file upload control1502 // but we don't want to break existing websites, who may be relying on being able to get the file name as a value.1503 1501 if (inputType() == FILE) { 1504 if (!m_fileList->isEmpty()) 1505 return m_fileList->item(0)->fileName(); 1502 if (!m_fileList->isEmpty()) { 1503 // HTML5 tells us that we're supposed to use this goofy value for 1504 // file input controls. Historically, browsers reveals the real 1505 // file path, but that's a privacy problem. Code on the web 1506 // decided to try to parse the value by looking for backslashes 1507 // (because that's what Windows file paths use). To be compatible 1508 // with that code, we make up a fake path for the file. 1509 return "C:\\fakepath\\" + m_fileList->item(0)->fileName(); 1510 } 1506 1511 return String(); 1507 1512 }
Note: See TracChangeset
for help on using the changeset viewer.