Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
<rdar://problem/8949683> WebKit2: Drag image is offset when the page …
…is scrolled down

https://bugs.webkit.org/show_bug.cgi?id=56265

Reviewed by Darin Adler.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag): Send the location in view coordinates rather than
document coordinates.



Canonical link: https://commits.webkit.org/70852@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Dan Bernstein committed Mar 13, 2011
1 parent d7cfc9a commit 320a5ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,14 @@
2011-03-13 Dan Bernstein <mitz@apple.com>

Reviewed by Darin Adler.

<rdar://problem/8949683> WebKit2: Drag image is offset when the page is scrolled down
https://bugs.webkit.org/show_bug.cgi?id=56265

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag): Send the location in view coordinates rather than
document coordinates.

2011-03-13 Dan Bernstein <mitz@apple.com>

Reviewed by Mark Rowe.
Expand Down
Expand Up @@ -90,14 +90,15 @@ - (id)initWithImage:(CachedImage*)image;
return bitmap.release();
}

void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, const IntPoint&, Clipboard*, Frame*, bool linkDrag)
void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, const IntPoint&, Clipboard*, Frame* frame, bool linkDrag)
{
RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get());
SharedMemory::Handle handle;
if (!bitmap->createHandle(handle))
return;

// FIXME: Seems this message should be named StartDrag, not SetDragImage.
m_page->send(Messages::WebPageProxy::SetDragImage(point, bitmap->size(), handle, linkDrag));
m_page->send(Messages::WebPageProxy::SetDragImage(frame->view()->contentsToWindow(point), bitmap->size(), handle, linkDrag));
}

static CachedImage* cachedImage(Element* element)
Expand Down

0 comments on commit 320a5ff

Please sign in to comment.