single-file input elements should refuse multi-file drags
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 00:35:42 +0000 (00:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 00:35:42 +0000 (00:35 +0000)
commit76c0798eb591dc6f3506646fe1102110b0803498
treee11441886a97385f098b0a4d8e694838716bf1c4
parent429f925f15962fea7e0a6d08af0988920600feb9
single-file input elements should refuse multi-file drags
https://bugs.webkit.org/show_bug.cgi?id=25913

Patch by Rakesh KN <rakesh.kn@motorola.com> on 2012-01-30
Reviewed by Eric Seidel.

Refuse the multiple file drags onto a single file input element.

Source/WebCore:

No new tests: Covered by existing tests, updated the expected results.

* page/DragController.cpp:
(WebCore::DragController::tryDocumentDrag):
Setting the dragSession.numberOfItemsToBeAccepted to 0 so that drag operation is none if the
file input element under mouse is single input type and number of files dragged onto that
input element are more than 1.

LayoutTests:

* editing/pasteboard/file-input-files-access-expected.txt:
Expected result changed.
* editing/pasteboard/script-tests/file-input-files-access.js:
(runTest):
Removed the 'FIXME' debug and comment as it is not valid after this change.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/file-input-files-access-expected.txt
LayoutTests/editing/pasteboard/script-tests/file-input-files-access.js
Source/WebCore/ChangeLog
Source/WebCore/page/DragController.cpp