RESOLVED FIXED 24735
Poor setDragImage support on Windows
https://bugs.webkit.org/show_bug.cgi?id=24735
Summary Poor setDragImage support on Windows
Sebastian Markbåge
Reported 2009-03-20 20:35:29 PDT
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 Mac this is supported for both images and elements. On Windows Safari has support for only images as the first parameter of setDragImage. It is not supported on <a> and <img> tags that has their own implementations that can't be overridden. Google Chrome has the function but no graphics shows up around the cursor for any drag operation. All versions should behave like the Mac version.
Attachments
Adds the ability to set an element as the drag image on Windows (5.11 KB, patch)
2009-06-24 08:52 PDT, Jessie Berlin
no flags
Jessie Berlin
Comment 1 2009-06-23 18:45:11 PDT
Jessie Berlin
Comment 2 2009-06-23 18:47:10 PDT
*** Bug 24734 has been marked as a duplicate of this bug. ***
Jessie Berlin
Comment 3 2009-06-24 08:52:52 PDT
Created attachment 31785 [details] Adds the ability to set an element as the drag image on Windows Does not fix the case of dragging a link where the default link image is still used, even when the -webkit-user-drag is set to "element". This is the same behavior as is found on OS X.
Adam Roben (:aroben)
Comment 4 2009-06-24 09:45:53 PDT
Comment on attachment 31785 [details] Adds the ability to set an element as the drag image on Windows > DragImageRef ClipboardWin::createDragImage(IntPoint& loc) const > { > HBITMAP result = 0; > - //FIXME: Need to be able to draw element <rdar://problem/5015942> > if (m_dragImage) { > result = createDragImageFromImage(m_dragImage->image()); > loc = m_dragLoc; > + } else if (m_dragImageElement) { > + Node* node = dragImageElement(); > + result = node->document()->frame()->nodeImage(node); > + loc = m_dragLoc; > } It's strange to use m_dragImageElement on the first line, then dragImageElement() on the second. I don't really have a preference, but using m_dragImageElement consistently would match the code above more closely. r=me
Jessie Berlin
Comment 5 2009-06-24 10:04:34 PDT
(In reply to comment #4) > (From update of attachment 31785 [details] [review]) > > DragImageRef ClipboardWin::createDragImage(IntPoint& loc) const > > { > > HBITMAP result = 0; > > - //FIXME: Need to be able to draw element <rdar://problem/5015942> > > if (m_dragImage) { > > result = createDragImageFromImage(m_dragImage->image()); > > loc = m_dragLoc; > > + } else if (m_dragImageElement) { > > + Node* node = dragImageElement(); changed to be: Node* node = m_dragImageElement.get(); > > + result = node->document()->frame()->nodeImage(node); > > + loc = m_dragLoc; > > } > > It's strange to use m_dragImageElement on the first line, then > dragImageElement() on the second. I don't really have a preference, but using > m_dragImageElement consistently would match the code above more closely. > > r=me >
Eric Seidel (no email)
Comment 6 2009-06-26 01:37:28 PDT
Does jberlin have commit-bit or does aroben plan to land this with modifications?
Adam Roben (:aroben)
Comment 7 2009-06-26 08:38:36 PDT
(In reply to comment #6) > Does jberlin have commit-bit Yes. <http://trac.webkit.org/search?q=jberlin&noquickjump=1&changeset=on>
Jessie Berlin
Comment 8 2009-06-26 08:47:04 PDT
(In reply to comment #6) > Does jberlin have commit-bit or does aroben plan to land this with > modifications? > I did commit, but I didn't mark it as fixed because the bug mentions the desire to see the link tag be able to be given a custom setDragImage and that is currently not supported on either mac or windows. Sorry I didn't respond earlier. For some reason I kept getting an "internal error" message when I navigated to this page.
Jessie Berlin
Comment 9 2009-06-26 09:09:51 PDT
Comment on attachment 31785 [details] Adds the ability to set an element as the drag image on Windows committed with revision 45087
Jessie Berlin
Comment 10 2009-07-24 17:08:00 PDT
Created a new bug for not being able to set the drag image of a link: https://bugs.webkit.org/show_bug.cgi?id=27670 Marking this bug as fixed, since the last committed patch addressed all other concerns.
Note You need to log in before you can comment on or make changes to this bug.