Bug 27670 - Unable to set drag image for a link using setDragImage
Summary: Unable to set drag image for a link using setDragImage
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-24 17:05 PDT by Jessie Berlin
Modified: 2013-07-24 11:43 PDT (History)
4 users (show)

See Also:


Attachments
Test case for setting the dragImage for a link. (1.25 KB, text/html)
2009-07-24 17:05 PDT, Jessie Berlin
no flags Details
Screenshot from Google Chrome 14.0.835.187 (88.02 KB, image/png)
2011-09-30 23:42 PDT, Rafał Miłecki
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Berlin 2009-07-24 17:05:29 PDT
Created attachment 33477 [details]
Test case for setting the dragImage for a link.

At the start of a drag operation you can use event.dataTransfer.setDragImage(...) to change the graphic to display by the cursor during the operation.

On Windows Safari it is not supported on <a> tags, which uses the default drag image for the link instead of whatever image is specified in by setDragImage.

(Breaking up https://bugs.webkit.org/show_bug.cgi?id=24735)
Comment 1 Rafał Miłecki 2011-09-30 23:42:53 PDT
Created attachment 109399 [details]
Screenshot from Google Chrome 14.0.835.187

It works fine here.
Comment 2 Rafał Miłecki 2011-09-30 23:49:21 PDT
Jessie: first of all your test case is invalid:
1) It doesn't have DOCTYPE (like HTML5's <!DOCTYPE html>)
2) You don't pass "event" in "ondragstart"
3) In "dragLinkAndSeeDivDragged" you use undefined event

Webkit recovers from last two issues by silently magically setting "event" inside the function. Thanks to that this test case *works* in my Google Chrome 14.0.835.187.

If you fix the issues I have mentioned, the test case starts working also in Firefox.


Please, re-test this bug, it seems to be fixes now.
Comment 3 Alexey Proskuryakov 2011-10-01 22:28:41 PDT
The behavior has improved since this bug was filed, the fix was in <http://trac.webkit.org/changeset/86472>.

But the drag image is still misplaced in WebKit nigtlies.

> Webkit recovers from last two issues by silently magically setting "event" inside the function.

It's not so magical, see <http://www.quirksmode.org/js/events_access.html> for a description of window.event. Besides, it's completely unrelated to this bug, so let's not discuss that here.