Discuss building things with or for the Mozilla Platform.
3 posts • Page 1 of 1
Neither the onDragDrop element attribute, as used in this demo:
http://developer.netscape.com/docs/tech ... ondrag.htm
or the ondragdrop window property (window.ondragdrop), as discussed here:
seem to work. They don't produce an error, but the handler never gets called.
This seems to be a capability left out of Mozilla (and in turn Firefox), yet there doesn't appear to be a bug report on it or discussion on the forums, which makes me wonder if it was an intentional omission. One reason why it might be intentional is that to fully handle drag-and-drop you potentially need to set many attributes (enabling the acceptance of dropped items, specifying the types of items accepted, etc.) and handlers, though you can get away with defaults in many cases. I could see developers arguing that merely providing a simple handler would be an incomplete solution, and thus leaving the feature out until someone was ready to implement the full capability. But I haven't seen any discussion like that.
I have found that the DOM specified technique:
document.addEventListener("dragdrop", handler, true);
works in Firefox (and I'd assume Mozilla), but still find it odd that the other documented forms are not functioning.
On a related matter, the DOM method doesn't seem to provide a way to communicate the dropped data. I think attributes of the Event object passed to the handler adequately communicate a reference to the source object when the source is on the same page (or at least the same application), but this doesn't seem to be the case when the source is another application. I've dissected the contents of the Event object passed to the handler, but I can't find any trace of the filename when dragging-and-dropping a file onto the browser window. One old example showed the data being passed as a second parameter to the event handler, but that doesn't seem to be happening now.
I've looked at the XUL equivalent:
> ...yet there doesn't appear to be a bug report on it...
Correction. I forgot I ran across this:
window.ondragdrop JS event is not getting triggered
in earlier research. Entered in 2001 and no meaningful activity since 2002.
But at least in confirms my observation, even if it doesn't explain why there isn't much interest in fixing it.
-> Mozilla Development
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest