Filter files from dataTransfer.getData on Mac
authorjpfau@apple.com <jpfau@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 18:19:00 +0000 (18:19 +0000)
committerjpfau@apple.com <jpfau@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 18:19:00 +0000 (18:19 +0000)
commit19fa3ac97688f1fe62dc2514e937477c5d0dd8dd
treec35c322a98d1d85c9807431c2370af731fd94515
parente4a3a5fc6f6f3d0bcf32f2f50ec3d1790673cd30
Filter files from dataTransfer.getData on Mac
https://bugs.webkit.org/show_bug.cgi?id=38876

Reviewed by Enrica Casucci.

Source/WebCore:

The ClipboardMac class now keeps track of whether it was created for copy and paste, dragging and dropping
files or dragging and dropping generic data. This enables the class to block calls to set-/getData when the
clipboard is not operating on generic data, and vice-versa.

Test: fast/events/drop-with-file-paths.html

* editing/mac/EditorMac.mm:
(WebCore::Editor::newGeneralClipboard):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::createDraggingClipboard):
* platform/mac/ClipboardMac.h:
(WebCore::ClipboardMac::create):
(ClipboardMac):
* platform/mac/ClipboardMac.mm:
(WebCore::Clipboard::create):
(WebCore::ClipboardMac::ClipboardMac):
(WebCore::ClipboardMac::getData):
(WebCore::ClipboardMac::setData):
(WebCore::ClipboardMac::files):

LayoutTests:

* fast/events/drop-with-file-paths-expected.txt: Added.
* fast/events/drop-with-file-paths.html: Added.
* fast/events/resources/file-for-drop-with-file-paths.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/drop-with-file-paths-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/drop-with-file-paths.html [new file with mode: 0644]
LayoutTests/fast/events/resources/file-for-drop-with-file-paths.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/platform/mac/ClipboardMac.h
Source/WebCore/platform/mac/ClipboardMac.mm