Closed Bug 1110116 Opened 10 years ago Closed 9 years ago

Argument 16 of DragEvent.initDragEvent does not implement interface DataTransfer.

Categories

(Core :: DOM: Events, defect, P1)

34 Branch
x86
Windows 7
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: manju271989, Unassigned)

References

Details

(Keywords: regression, steps-wanted, Whiteboard: [closeme 2016-04-15])

Attachments

(1 file)

Attached file draganddrop.html
User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 Steps to reproduce: 1. I have created sample drag and drop html page. 2. I have fired series of events: MouseMove,MouseDown,Dragstart,MouseMove,Drag,MouseOver,DragOver,Drop,MouseUp. Actual results: After firefox version:33, it starts throwing error: Argument 16 of DragEvent.initDragEvent does not implement interface DataTransfer. when I checked in firefox 27, the implementation of dragdrop is successful through initdragevet. Now, it is not possible. Expected results: It should have completed the drag and drop operation: please find the js file for implementing the javascript function. try{var source = arguments[0];var target = arguments[1];var x1 = arguments[2];var y1 = arguments[3];var x2 = arguments[4];var y2 = arguments[5];var Drageventdata = function(){this.data = {};this.setData = function(df, d) {this.data[df] = d;alert('this is from setdata:'+d);return true;}; this.getData = function(df){return this.data[df];}; this.clearData = function(df){if (df) delete this.data[df];else this.data = {};}; }; function findAbsolutePosition(){this.dataTransfer = new Drageventdata;var mousemoveevt = document.createEvent('MouseEvent');mousemoveevt.initMouseEvent('mousemove', true, true,document.defaultview,0,null,null,x1,y1, false, false, false, false, 0, null);source.dispatchEvent(mousemoveevt);alert('mousemove');var mouseoverevt = document.createEvent('MouseEvent');mouseoverevt.initMouseEvent('mouseover', true, true,document.defaultview,0,null,null,x1,y1, false, false, false, false, 0, null);source.dispatchEvent(mouseoverevt);var mousedownevt = document.createEvent('MouseEvent');mousedownevt.initMouseEvent('mousedown', true, true,document.defaultview,0,null,null,x1,y1, false, false, false, false, 0, null);source.dispatchEvent(mousedownevt);var dragstartevt =document.createEvent ('Dragevent');dragstartevt.initDragEvent('dragstart',true,true,document.defaultview,0,null,null,x1,y1,false,false,false,false,0,this.relatedTarget,this.dataTransfer);source.dispatchEvent(dragstartevt);alert(this.relatedTarget+','+this.dataTransfer);var dragevt =document.createEvent ('Dragevent');dragevt.initDragEvent('drag',true,true,document.defaultview,0,null,null,x1,y1,false,false,false,false,0,this.relatedTarget,this.dataTransfer);source.dispatchEvent(dragevt);var mousesourcemoveevt = document.createEvent('MouseEvent');var a = x2;mousesourcemoveevt.initMouseEvent('mousemove', true, true,document.defaultview,0,null,null,a,y2, false, false, false, false, 0, null);source.dispatchEvent(mousesourcemoveevt);var sourcedragevt =document.createEvent ('Dragevent');sourcedragevt.initDragEvent('drag',true,true,document.defaultview,0,null,null,a,y2,false,false,false,false,0,this.relatedTarget,this.dataTransfer);source.dispatchEvent(sourcedragevt); var targetmouseoverevt = document.createEvent('MouseEvent');mouseoverevt.initMouseEvent('mouseover', true, true,document.defaultview,0,null,null,a,y2, false, false, false, false, 0, null);target.dispatchEvent(mouseoverevt);var targetdragenterevt =document.createEvent ('Dragevent');targetdragenterevt.initDragEvent('dragenter',true,true,document.defaultview,0,null,null,a,y2,false,false,false,false,0,this.relatedTarget,this.dataTransfer);target.dispatchEvent(targetdragenterevt);var targetdragoverevt =document.createEvent ('Dragevent');targetdragoverevt.initDragEvent('dragover',true,true,document.defaultview,0,null,null,a,y2,false,false,false,false,0,this.relatedTarget,this.dataTransfer);target.dispatchEvent(targetdragoverevt);var targetmouseupevt = document.createEvent('MouseEvent');targetmouseupevt.initMouseEvent('mouseup', true, true,document.defaultview,0,null,null,a,y2, false, false, false, false, 0, null);target.dispatchEvent(targetmouseupevt);var sourcemouseupevt = document.createEvent('MouseEvent');sourcemouseupevt.initMouseEvent('mouseup', true, true,document.defaultview,0,null,null,a,y2, false, false, false, false, 0, null);source.dispatchEvent(sourcemouseupevt);var dropevt =document.createEvent ('Dragevent');dropevt.initDragEvent('drop',true,true,document.defaultview,0,null,null,a,y2,false,false,false,false,0,this.relatedTarget,this.dataTransfer);target.dispatchEvent(dropevt);}findAbsolutePosition();}catch(err){alert(err);}",source,target,source.getLocation().x,source.getLocation().y,target.getLocation().x,target.getLocation().y); }
Severity: normal → blocker
Priority: -- → P1
Component: Untriaged → DOM: Events
Keywords: regression
Product: Firefox → Core
Flags: needinfo?(twalker)
Flags: needinfo?(anthony.s.hughes)
Taking QA Contact to investigate the regression window.
Flags: needinfo?(twalker)
Flags: needinfo?(anthony.s.hughes)
QA Contact: anthony.s.hughes
Flagging myself so this doesn't fall off my radar.
Flags: needinfo?(anthony.s.hughes)
var Drageventdata = function(){this.data = {};this.setData = function(df, d) {this.data[df] = d;alert('this is from setdata:'+d);return true;}; this.getData = function(df){return this.data[df];}; this.clearData = function(df){if (df) delete this.data[df];else this.data = {};}; }; this.dataTransfer = new Drageventdata; ... dragstartevt.initDragEvent('dragstart',true,true,document.defaultview,0,null,null,x1,y1,false,false,false,false,0,this.relatedTarget,this.dataTransfer); so clearly the 16th param doesn't implement interface DataTransfer. But bug 856351 landed long ago.
The spec https://html.spec.whatwg.org/multipage/interaction.html#the-dragevent-interface doesn't have initDragEvent at all (all the init*Event are deprecated anyway), and per spec event.dataTransfer must be either null or real DataTransfer object.
I tried to reproduce this in Firefox 35.0.1 but can't. Can I please get clearer steps to reproduce?
Flags: needinfo?(anthony.s.hughes)
Keywords: steps-wanted
Firefox: 45.0,Build ID: 20160303134406 User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Hi reporter, I have tested this issue on the latest Firefox (45.0) release, latest Nightly (48.0a1 Build ID: 20160314030215) build, but I could not reproduce it. I have used the provided test case, and I was able to complete the drag and drop operation without any error. Is this still reproducible on your end ? If yes, can you please retest this using latest Firefox release and latest Nightly build (https://nightly.mozilla.org/) and report back the results ? When doing this, please use a new clean Firefox profile, maybe even safe mode, to eliminate custom settings as a possible cause (https://goo.gl/PNe90E). Thanks, Cosmin.
Flags: needinfo?(manju271989)
Whiteboard: [closeme 2016-04-15]
Considering the fact that I cannot reproduce this and the fact that the reporter did not answered to my request until now, I will mark this as Resolved-Worksforme. If anyone can still reproduce it, feel free to reopen the issue and provide more information. Thanks, Cosmin.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(manju271989)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: