RESOLVED FIXED 56486
[Qt] HTML5 Drag and Drop demos not working
https://bugs.webkit.org/show_bug.cgi?id=56486
Summary [Qt] HTML5 Drag and Drop demos not working
Aparna Nandyal
Reported 2011-03-16 13:43:21 PDT
Steps to reproduce the problem: 1. Open QtTestBrowser or a sample QWebView program which does (QWebView view; view.show(); view.load(QUrl("any urls given below")); 2. Load any of the URLs - http://html5demos.com/drag, http://html5demos.com/drag-anything, http://shapeshed.com/examples/drag-and-drop/, http://html5tutorial.net/examples/html5-drag-and-drop.html or other popular demos for html5 D&D. 3. Follow the instructions given in the url. All the URLs allow dragging of some content and dropping it off in designated area. Expected results: Drag and drop works fine as stated in the URL Actual result: Drop is not working as mentioned in the url. Unable to drop the content.
Attachments
Patch (1.50 KB, patch)
2011-04-05 07:04 PDT, Benjamin Poulain
kling: review+
kling: commit-queue-
Benjamin Poulain
Comment 1 2011-04-05 07:04:33 PDT
Benjamin Poulain
Comment 2 2011-04-05 07:05:29 PDT
Covered by existing tests but the DRT does not yet have support for Drag and Drop unfortunatelly.
Benjamin Poulain
Comment 3 2011-04-05 07:13:26 PDT
*** Bug 52601 has been marked as a duplicate of this bug. ***
Aparna Nandyal
Comment 4 2011-04-05 09:58:43 PDT
This fix does not solve the problem with all D&D urls mentioned below. http://html5tutorial.net/examples/html5-drag-and-drop.html example still fails with this fix. I have been working to fix the issue with that. Analysis: 1. For html5 D&D, preventDefault is used to allow dropping in dragOver. addEvent(bin, 'dragover', function (e) { if (e.preventDefault) e.preventDefault(); // allows us to drop this.className = 'over'; e.dataTransfer.dropEffect = 'copy'; alert('Hahaha'); return false; }); 2. In some implementations it returns false instead of calling preventDefault (IE expects return false) to allow dropping. addEvent(bin, 'dragover', function (e) { this.className = 'over'; e.dataTransfer.dropEffect = 'copy'; alert('Hahaha'); return false; //allows us to drop }); 3. If preventDefault is called on the event, then m_defaultPrevented is set to true and droppping succeeds in webkit. 4. So we need to set, m_defaultPrevented even when false is returned (as in step 2) to let dropping succeed. 5. setReturnValue of Event.h needs to be called. Working on a fix for this.
Aparna Nandyal
Comment 5 2011-04-05 10:07:55 PDT
Missed mentioning - Patch given by Benjamin is required, in addition to it we need to make changes mentioned in comment#4.
Andreas Kling
Comment 6 2011-04-08 11:26:30 PDT
Comment on attachment 88223 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=88223&action=review r=me > Source/WebKit/qt/ChangeLog:12 > + what action should take place. To adtop this behavior for Qt, we always accept drag enter events Typo, s/adtop/adopt/
Benjamin Poulain
Comment 7 2011-04-11 07:53:04 PDT
Note You need to log in before you can comment on or make changes to this bug.