<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>56486</bug_id>
          
          <creation_ts>2011-03-16 13:43:21 -0700</creation_ts>
          <short_desc>[Qt] HTML5 Drag and Drop demos not working</short_desc>
          <delta_ts>2011-04-11 07:53:04 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>58206</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Aparna Nandyal">aparna.nand</reporter>
          <assigned_to name="Benjamin Poulain">benjamin</assigned_to>
          <cc>benjamin</cc>
    
    <cc>ragner.magalhaes</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>368504</commentid>
    <comment_count>0</comment_count>
    <who name="Aparna Nandyal">aparna.nand</who>
    <bug_when>2011-03-16 13:43:21 -0700</bug_when>
    <thetext>Steps to reproduce the problem:

1. Open QtTestBrowser or a sample QWebView program which does (QWebView view; view.show(); view.load(QUrl(&quot;any urls given below&quot;));
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&amp;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379526</commentid>
    <comment_count>1</comment_count>
      <attachid>88223</attachid>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-04-05 07:04:33 -0700</bug_when>
    <thetext>Created attachment 88223
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379527</commentid>
    <comment_count>2</comment_count>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-04-05 07:05:29 -0700</bug_when>
    <thetext>Covered by existing tests but the DRT does not yet have support for Drag and Drop unfortunatelly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379532</commentid>
    <comment_count>3</comment_count>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-04-05 07:13:26 -0700</bug_when>
    <thetext>*** Bug 52601 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379686</commentid>
    <comment_count>4</comment_count>
    <who name="Aparna Nandyal">aparna.nand</who>
    <bug_when>2011-04-05 09:58:43 -0700</bug_when>
    <thetext>This fix does not solve the problem with all D&amp;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&amp;D, preventDefault is used to allow dropping in dragOver.

  addEvent(bin, &apos;dragover&apos;, function (e) {
    if (e.preventDefault) e.preventDefault(); // allows us to drop
    this.className = &apos;over&apos;;
    e.dataTransfer.dropEffect = &apos;copy&apos;;
    alert(&apos;Hahaha&apos;);
    return false;
  });


2. In some implementations it returns false instead of calling preventDefault (IE expects return false) to allow dropping.

  addEvent(bin, &apos;dragover&apos;, function (e) {
    this.className = &apos;over&apos;;
    e.dataTransfer.dropEffect = &apos;copy&apos;;
    alert(&apos;Hahaha&apos;);
    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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379696</commentid>
    <comment_count>5</comment_count>
    <who name="Aparna Nandyal">aparna.nand</who>
    <bug_when>2011-04-05 10:07:55 -0700</bug_when>
    <thetext>Missed mentioning - Patch given by Benjamin is required, in addition to it we need to make changes mentioned in comment#4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>382401</commentid>
    <comment_count>6</comment_count>
      <attachid>88223</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2011-04-08 11:26:30 -0700</bug_when>
    <thetext>Comment on attachment 88223
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=88223&amp;action=review

r=me

&gt; Source/WebKit/qt/ChangeLog:12
&gt; +        what action should take place. To adtop this behavior for Qt, we always accept drag enter events

Typo, s/adtop/adopt/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>383166</commentid>
    <comment_count>7</comment_count>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-04-11 07:53:04 -0700</bug_when>
    <thetext>Committed r83442: &lt;http://trac.webkit.org/changeset/83442&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>88223</attachid>
            <date>2011-04-05 07:04:33 -0700</date>
            <delta_ts>2011-04-08 11:26:30 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>56486.diff</filename>
            <type>text/plain</type>
            <size>1539</size>
            <attacher name="Benjamin Poulain">benjamin</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvcXQvQXBpL3F3ZWJwYWdlLmNwcCBiL1NvdXJjZS9X
ZWJLaXQvcXQvQXBpL3F3ZWJwYWdlLmNwcAppbmRleCBhYzFkNTYyLi5iNWQ1OTIyIDEwMDY0NAot
LS0gYS9T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AgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NTY0ODYK
KworICAgICAgICBIYW5kbGluZyB0aGUgZHJvcCB3aXRoIEphdmFTY3JpcHQgd2FzIG5vdCB3b3Jr
aW5nIHdpdGggUXQgYmVjYXVzZSBpZiB0aGUgYWN0aW9uIGlzIGlnbm9yZWQKKyAgICAgICAgaW4g
cmVzcG9uc2UgdG8gRHJhZ0VudGVyLCBubyBmdXJ0aGVyIGV2ZW50cyBhcmUgc2VudCB0byB0aGUg
dmlldy4KKworICAgICAgICBEcmFnIGFuZCBkcm9wIGlzIGRlZmluZWQgYW5kIHVzZWQgZGlmZmVy
ZW50bHkgYnkgd2VicGFnZXMuIFRoZSBkcmFnIG1vdmUgZXZlbnRzIGFyZSBkZXRlcm1pbmluZwor
ICAgICAgICB3aGF0IGFjdGlvbiBzaG91bGQgdGFrZSBwbGFjZS4gVG8gYWR0b3AgdGhpcyBiZWhh
dmlvciBmb3IgUXQsIHdlIGFsd2F5cyBhY2NlcHQgZHJhZyBlbnRlciBldmVudHMKKyAgICAgICAg
b24gdGhlIHdpZGdldC4KKworICAgICAgICAqIEFwaS9xd2VicGFnZS5jcHA6CisgICAgICAgIChR
V2ViUGFnZVByaXZhdGU6OmRyYWdFbnRlckV2ZW50KToKKwogMjAxMS0wNC0wNCAgQ2hhbmcgU2h1
ICA8Y3NodUB3ZWJraXQub3JnPgogCiAgICAgICAgIFJldmlld2VkIGJ5IFJ5b3N1a2UgTml3YS4K
</data>
<flag name="review"
          id="80694"
          type_id="1"
          status="+"
          setter="kling"
    />
    <flag name="commit-queue"
          id="80695"
          type_id="3"
          status="-"
          setter="kling"
    />
          </attachment>
      

    </bug>

</bugzilla>