[Webkit-unassigned] [Bug 58206] HTML5 drag and drop not working when getData is used

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 10 10:59:49 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=58206


Aparna Nandyal <aparna.nand at wipro.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |56486




--- Comment #1 from Aparna Nandyal <aparna.nand at wipro.com>  2011-04-10 10:59:50 PST ---
Analysis:
It is found that the value returned by getData in the following script in wrong:


function dragOver(ev) {
    var idelt = ev.dataTransfer.getData("Text");
    var id = ev.target.getAttribute('id');
    if( (id =='boxB' || id =='boxA') && (idelt == 'drag' || idelt=='drag2'))
        return false;
    else if( id =='boxC' && idelt == 'drag3')
        return false;
    else
        return true;
}

idelt is always undefined. On the other hand if the same web page (http://ljouanneau.com/lab/html5/demodragdrop.html) is downloaded and saved as html and opened through the QtTestBrowser, it works fine. 

Problem in the code:
String ClipboardQt::getData(const String& type, bool& success) const
{

    if (policy() != ClipboardReadable) {
        success = false;
        return String();
    }

    ....
}

The policy value is set as ClipboardTypesReadable in this case hence empty string is returned. The policy value is set in DragController::tryDHTMLDrag. If the URL is local, then clipboardReadable is set (which is why it works when the same html page is saved locally and then loaded in QtTestBrowser) else clipboardTypesReadable is set. 


Additional information: To get this fix working, patch in https://bugs.webkit.org/show_bug.cgi?id=56486 is a required (which is to get generic HTML5 drag and drop to work)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list