REGRESSION: Drag & Drop Gmail Attachments doesn't work.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 18:03:32 +0000 (18:03 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 18:03:32 +0000 (18:03 +0000)
commit98d365f85ae618be08fcd09d306cc20e28f6217d
treef00e9dcab2a7a449acd3119ad23baa3ee6df380b
parentbd93084ca6c8e5b0f8fd4fffbe783609ee4a3ddc
REGRESSION: Drag & Drop Gmail Attachments doesn't work.
https://bugs.webkit.org/show_bug.cgi?id=57909
<rdar://problem/9103220>

Reviewed by Darin Adler.

Source/WebCore:

In WebKit2 we cannot rely on the value returned by platformData() that
on Mac returns an NSDraggingInfo object. This is available only in the UI
process. Therefore we should use m_pasteboard instead.
We cannot change what platformData() returns on Mac, since there are
delegate methods that receive a NSDraggingInfo object (only in WebKit).

* platform/DragData.h:
(WebCore::DragData::pasteboard): Added.
* platform/mac/ClipboardMac.mm:
(WebCore::Clipboard::create): Changed to use pasteboard() instead of platformData().
* platform/mac/DragDataMac.mm:
(WebCore::DragData::asColor): Replaced references to m_platformData with m_pasteboard.
(WebCore::DragData::asURL): Same as above.

Source/WebKit2:

Added _hitTest method to support drag and drop when the drag types cannot be matched.
This is the case for elements that do not place content
in the drag pasteboard automatically when the drag start (i.e. dragging a DIV element).

* UIProcess/API/mac/WKView.mm:
(-[WKView _hitTest:dragTypes:]): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/DragData.h
Source/WebCore/platform/mac/ClipboardMac.mm
Source/WebCore/platform/mac/DragDataMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm