<?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>29264</bug_id>
          
          <creation_ts>2009-09-14 17:43:12 -0700</creation_ts>
          <short_desc>|pdwEffect| passed to WebView::Drop is incorrect.</short_desc>
          <delta_ts>2012-11-10 19:22:48 -0800</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>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aroben</cc>
    
    <cc>eric</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>147231</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2009-09-14 17:43:12 -0700</bug_when>
    <thetext>The value of the drop effect (|pdwEffect|) passed to WebView::Drop is incorrect. That is, it does not reflect the drop effect as seen by the last WebView::DragOver call.

A temporary workaround is to store the last drop effect in WebView::m_lastDropEffect. We set this variable in WebView::DragEnter and WebView::DragOver so that it can be used in WebView::Drop to set the correct drop effect. Thus, on return from DoDragDrop (http://msdn.microsoft.com/en-us/library/ms678486%28VS.85%29.aspx) we have the correct |pdwEffect| for the drag-and-drop operation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150453</commentid>
    <comment_count>1</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2009-09-27 20:49:13 -0700</bug_when>
    <thetext>This is a bug in WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>150493</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2009-09-28 06:06:03 -0700</bug_when>
    <thetext>How can we fix this? WebKit isn&apos;t calling WebView::Drop itself. Isn&apos;t this a bug in the caller of WebView::Drop?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151634</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2009-10-01 11:28:38 -0700</bug_when>
    <thetext>Oops, I misspoke. It &quot;may&quot; be a Microsoft bug.

I say may because it is not explicitly clear from the DoDragDrop API &lt;http://msdn.microsoft.com/en-us/library/ms678486%28VS.85%29.aspx&gt; what the value of pdwEffect will be when Drop is called.

The API states that:
&quot;If the return value is DRAGDROP_S_DROP, DoDragDrop calls IDropTarget::Drop. The DoDragDrop function returns the last effect code to the source, so the source application can perform the appropriate operation on the source data, for example, cut the data if the operation was a move.&quot;

But does not elaborate what &quot;last effect code&quot; means. On first read, I took it to mean the last effect code as set by some function (either DragEnter, DragOver, or Drop) during the course of the drag-and-drop operation. That is, suppose only one of the aforementioned functions sets the drop effect code, say DragEnter, and that the drop effect is set to DROPEFFECT_COPY. Then, the pdwEffect passed to DragOver, and Drop will be DROPEFFECT_COPY and unless these functions explicitly change it, DROPEFFECT_COPY would be the last effect code.

This is not the case. From working in the debugger, it appears that the &quot;last effect code&quot; means the value of the parameter dwOKEffects (as passed to DoDragDrop) unless changed in the Drop function (by setting pdwEffect to something else). (i.e. by default, Drop is passed pdwEffect = dwOKEffects).

(In reply to comment #2)
&gt; How can we fix this? WebKit isn&apos;t calling WebView::Drop itself. Isn&apos;t this a
&gt; bug in the caller of WebView::Drop?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763635</commentid>
    <comment_count>4</comment_count>
      <attachid>173446</attachid>
    <who name="">danya.postfactum</who>
    <bug_when>2012-11-10 05:23:17 -0800</bug_when>
    <thetext>Created attachment 173446
Demonstrates wrong dropEffect on drop

Holy shit! Almost 2013 year, and this bug still is present.

Open attachment in Chrome or Safari. Open Console. Grag the link and drop it on document. You get &quot;drop none&quot; instead of &quot;drop move&quot; (the script set dropEffect to &quot;move&quot; on dragenter/dragover.

I have reproduced this bug on all platforms - Linux, Windows 7, Mac OS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763771</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-11-10 19:22:48 -0800</bug_when>
    <thetext>Please file a new bug about what you are seeing on Mac. This bug is very specifically about Windows, and it will not be used to track the issue you are seeing.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>173446</attachid>
            <date>2012-11-10 05:23:17 -0800</date>
            <delta_ts>2012-11-10 05:23:17 -0800</delta_ts>
            <desc>Demonstrates wrong dropEffect on drop</desc>
            <filename>dnd-test.html</filename>
            <type>text/html</type>
            <size>850</size>
            <attacher>danya.postfactum</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCiAgICA8aGVhZD4NCiAgICAgICAgPHRpdGxlPjwvdGl0
bGU+DQogICAgPC9oZWFkPg0KICAgIDxib2R5Pg0KICAgIAk8YSBocmVmPSIjIiBpZD0iZHJhZ2dh
YmxlIj5EcmFnZ2FibGU8L2E+DQogICAgCTxzY3JpcHQ+DQogICAgCQl2YXIgZHJhZ2dhYmxlID0g
ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2RyYWdnYWJsZScpOw0KICAgIAkJdmFyIGRyb3B6b25l
ID0gZG9jdW1lbnQ7DQogICAgCQlkcmFnZ2FibGUuYWRkRXZlbnRMaXN0ZW5l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