Open Bug 1203368 Opened 5 years ago Updated 5 years ago

ondragstart cursor title or image


(Core :: DOM: Events, enhancement)

40 Branch
Not set





(Reporter: hauser, Unassigned)


User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Build ID: 20150826023504

Steps to reproduce:

in a drag and drop situation, I would like to add to the cursor some explanatory text what will happen upon drop.

Actual results:

document.body.ondragover = function(event) {
     event.dataTransfer.dropEffect = 'copy';

only gives a very limited way to explain.

Expected results:

document.body.ondragover = function(event) { = "drop to upload or any other explation text";
should work.
Three more fall-back approaches didn't work:
1) document.body.ondragover = function(event) { = "url(/images/paper-clip.gif), auto"; 
was ignored - on debian a standard cursor was shown, on win7 a thumbnail of the dragged file

2) the same approach via css failed too

.ondragover {
   cursor: url(/images/paper-clip.gif) !important;
had no effect

3) document.body.ondragover = function(event) {
        var imgDrag = document.createElement("img");
      imgDrag.src = "/images/paper-clip.gif";
      event.dataTransfer.setDragImage(imgDrag, 0, 0);

    --> results in NoModificationAllowedError: Modifications are not allowed for this document

==> Any hints are appreciated
Severity: normal → enhancement
Component: Untriaged → DOM: Events
Product: Firefox → Core
Ralf, if you need this kinds of improvements to DND API, please file a specification bug. 
DND API is defined in HTML spec, and bugs can be filed in
Olli, Thanks for the suggestion. Done in
You need to log in before you can comment on or make changes to this bug.