Open Bug 503158 Opened 12 years ago Updated 9 years ago

Drag & Drop: Drop event

Categories

(Core :: DOM: Drag & Drop, defect)

1.9.1 Branch
x86
Windows XP
defect
Not set
major

Tracking

()

UNCONFIRMED

People

(Reporter: yunjuan.li, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.33 Safari/530.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 XPCOMViewer/0.9a

This is the example from mozilla development center. 
https://developer.mozilla.org/samples/dragdrop/dragevents.html
The resource code is in:
https://developer.mozilla.org/samples/dragdrop/dragevents.txt

The problem is we can not catch the "drop event" or 
the follow code "dragService.getCurrentSession().canDrop = true;" throw an exception. 

Reproducible: Always

Steps to Reproduce:
1.go the link "https://developer.mozilla.org/samples/dragdrop/dragevents.html:"
2.do drag and drop the image
3.Can't not drop 


Expected Results:  
This is the code: 
function eventReceived(event)
{
  if ((event.type == "dragenter") || (event.type == "dragover"))
    dragService.getCurrentSession().canDrop = true;
  var output = document.getElementById("output");
  output.textContent += event.type + "\n";
}

Except result: document should show "drop"
Component: General → Drag and Drop
Product: Firefox → Core
QA Contact: general → drag-drop
Version: unspecified → 1.9.1 Branch
reproduced on

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7) Gecko/20100101 Firefox/4.0b7 ID:20101104142426
and 
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b8pre) Gecko/20101210 Firefox/4.0b8pre ID:20101210044843

(the image is not captured)

but, drag image work with

http://demos.hacks.mozilla.org/openweb/DnD/
Whatever this example, it should just be removed as it uses the now deprecated api.
You need to log in before you can comment on or make changes to this bug.