Changeset 106301 in webkit
- Timestamp:
- Jan 30, 2012 4:35:42 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r106300 r106301 1 2012-01-30 Rakesh KN <rakesh.kn@motorola.com> 2 3 single-file input elements should refuse multi-file drags 4 https://bugs.webkit.org/show_bug.cgi?id=25913 5 6 Reviewed by Eric Seidel. 7 8 Refuse the multiple file drags onto a single file input element. 9 10 * editing/pasteboard/file-input-files-access-expected.txt: 11 Expected result changed. 12 * editing/pasteboard/script-tests/file-input-files-access.js: 13 (runTest): 14 Removed the 'FIXME' debug and comment as it is not valid after this change. 15 1 16 2012-01-30 Dana Jansens <danakj@chromium.org> 2 17 -
trunk/LayoutTests/editing/pasteboard/file-input-files-access-expected.txt
r74510 r106301 23 23 FAIL fileInput.value should be . Was C:\fakepath\directory-for-dragging. 24 24 FAIL fileInput.files.length should be 0. Was 1. 25 FIXME: Single-file input elements should refuse multi-file drags. See https://bugs.webkit.org/show_bug.cgi?id=2591326 25 Dragging two files to a single-file input control: 27 FAIL fileInput.value should be . Was C:\fakepath\apple.gif. 28 FAIL fileInput.files.length should be 0. Was 1. 26 PASS fileInput.value is "" 27 PASS fileInput.files.length is 0 29 28 Dragging a file and a directory onto a single-file input control: 30 FAIL fileInput.value should be . Was C:\fakepath\apple.gif. 31 FAIL fileInput.files.length should be 0. Was 1. 29 PASS fileInput.value is "" 30 PASS fileInput.files.length is 0 32 31 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 32 Dragging a directory and a file onto a single-file input control: 34 FAIL fileInput.value should be . Was C:\fakepath\directory-for-dragging. 35 FAIL fileInput.files.length should be 0. Was 1. 33 PASS fileInput.value is "" 34 PASS fileInput.files.length is 0 36 35 Dragging three files to a multi-file input control: 37 36 PASS fileInput.value is "C:\\fakepath\\apple.gif" -
trunk/LayoutTests/editing/pasteboard/script-tests/file-input-files-access.js
r99108 r106301 90 90 draggingPathsShouldResultInFiles(['resources/directory-for-dragging'], []); 91 91 92 // FIXME: Current behavior is to take the first file, but I expect that's93 // confusing to the user. We should change this to expect drag failure.94 debug("FIXME: Single-file input elements should refuse multi-file drags. See https://bugs.webkit.org/show_bug.cgi?id=25913")95 92 debug("Dragging two files to a single-file input control:") 96 93 draggingPathsShouldResultInFiles(['resources/apple.gif', 'resources/mozilla.gif'], []); -
trunk/Source/WebCore/ChangeLog
r106300 r106301 1 2012-01-30 Rakesh KN <rakesh.kn@motorola.com> 2 3 single-file input elements should refuse multi-file drags 4 https://bugs.webkit.org/show_bug.cgi?id=25913 5 6 Reviewed by Eric Seidel. 7 8 Refuse the multiple file drags onto a single file input element. 9 10 No new tests: Covered by existing tests, updated the expected results. 11 12 * page/DragController.cpp: 13 (WebCore::DragController::tryDocumentDrag): 14 Setting the dragSession.numberOfItemsToBeAccepted to 0 so that drag operation is none if the 15 file input element under mouse is single input type and number of files dragged onto that 16 input element are more than 1. 17 1 18 2012-01-30 Dana Jansens <danakj@chromium.org> 2 19 -
trunk/Source/WebCore/page/DragController.cpp
r106247 r106301 360 360 else if (m_fileInputElementUnderMouse->multiple()) 361 361 dragSession.numberOfItemsToBeAccepted = numberOfFiles; 362 else if (numberOfFiles > 1) 363 dragSession.numberOfItemsToBeAccepted = 0; 362 364 else 363 365 dragSession.numberOfItemsToBeAccepted = 1;
Note: See TracChangeset
for help on using the changeset viewer.