Summary: | [Qt] HTML5 Drag and Drop demos not working | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Aparna Nandyal <aparna.nand> | ||||
Component: | New Bugs | Assignee: | Benjamin Poulain <benjamin> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | benjamin, ragner.magalhaes | ||||
Priority: | P2 | Keywords: | Qt, QtTriaged | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 58206 | ||||||
Attachments: |
|
Description
Aparna Nandyal
2011-03-16 13:43:21 PDT
Created attachment 88223 [details]
Patch
Covered by existing tests but the DRT does not yet have support for Drag and Drop unfortunatelly. *** Bug 52601 has been marked as a duplicate of this bug. *** 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. Missed mentioning - Patch given by Benjamin is required, in addition to it we need to make changes mentioned in comment#4. 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/ Committed r83442: <http://trac.webkit.org/changeset/83442> |