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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13203</bug_id>
          
          <creation_ts>2011-07-11 08:34:31 +0000</creation_ts>
          <short_desc>Drag-and-drop model should clearly state when and whether a drag is canceled, for Mac-like and X-like drag-cancel effects</short_desc>
          <delta_ts>2011-11-15 12:56:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#dndevents</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>a11y, a11y_drag-drop</keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>gez.lemon</cc>
    
    <cc>gianni+w3c</cc>
    
    <cc>ian</cc>
    
    <cc>jonas.westerlund</cc>
    
    <cc>laura.lee.carlson</cc>
    
    <cc>mike</cc>
    
    <cc>miket</cc>
    
    <cc>public-html-a11y</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50892</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-07-11 08:34:31 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html
Multipage: http://www.whatwg.org/C#dndevents
Complete: http://www.whatwg.org/c#dndevents

Comment:
There does not seem to be a way to cancel a drag and drop operation at a point
later than when `dragenter` fires. Often it is useful to be able to cancel it
when the draggable item is dropped, when you know where it is being dropped. I
think it would be great if there was a way to cancel the action, like when you
use the escape key, from script. 

Posted from: 212.181.83.218
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53470</commentid>
    <comment_count>1</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:14:10 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54152</commentid>
    <comment_count>2</comment_count>
    <who name="Jonas">jonas.westerlund</who>
    <bug_when>2011-08-04 07:04:21 +0000</bug_when>
    <thetext>Another scenario where it would be useful to be able to abort a D&amp;D action at a later point,
is when you need to inspect the data in the DataTransfer object to determine if you will accept it or not.
Something might accept dropping of URIs, but not all URIs will work. It would then be nice to be able to cancel the d&amp;d action.
Currently, if I am reading the spec right, you can only set data during the `dragstart` event, and you can only read it during the `drop` event.
It&apos;s then too early to cancel it during `dragstart` (might start in another application too), and too late to cancel it in `drop`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55461</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-19 02:59:22 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Did Not Understand Request
Change Description: no spec change
Rationale: I don&apos;t understand. Why is it too late to cancel it in the drop?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55466</commentid>
    <comment_count>4</comment_count>
    <who name="Jonas">jonas.westerlund</who>
    <bug_when>2011-08-19 07:01:05 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Status: Did Not Understand Request
&gt; Change Description: no spec change
&gt; Rationale: I don&apos;t understand. Why is it too late to cancel it in the drop?

It is too late because there is no way to abort the D&amp;D action at that point, as far as I can tell.
You can only abort in by not accepting drops at all, and at *that* point, you can not read the DataTransfer data in order to make a decision.

The only thing you can do is accept the drop, read the data, then indicate failure some other way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55509</commentid>
    <comment_count>5</comment_count>
    <who name="Gianni Chiappetta">gianni+w3c</who>
    <bug_when>2011-08-19 20:04:31 +0000</bug_when>
    <thetext>I think Jonas&apos; use-case is as simple as he needs to cancel a drag after `dragenter`, based on certain criteria, so it can return to it&apos;s origin. I haven&apos;t personally tested this, but this seems like a pretty basic (and necessary) behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55657</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-23 05:13:00 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: It&apos;s trivial to cancel the drop in the drop code. Just don&apos;t do anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55671</commentid>
    <comment_count>7</comment_count>
    <who name="Jonas">jonas.westerlund</who>
    <bug_when>2011-08-23 08:17:39 +0000</bug_when>
    <thetext>&gt; Rationale: It&apos;s trivial to cancel the drop in the drop code. Just don&apos;t do
&gt; anything.

Accepting the drop and doing nothing leads to different behavior.

This is different on Windows and OS X, so I suggest checking it out on Chrome (or Safari or FireFox) on OS X, to make it clearer what I mean.

Example here:
http://jsbin.com/oyujuz/3

Chrome 12 on Ubuntu behaves like the aforementioned browsers on OS X, as well.

I hope this clears things up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56261</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-04 03:29:41 +0000</bug_when>
    <thetext>Ah, yeah, as specced the model totally ignores Mac-like drag cancelation effects.

That shouldn&apos;t be hard to fix. Basically, whenever the &quot;current drag operation&quot; is &quot;none&quot; after the &quot;dragend&quot; event, the drag should be considered to be canceled. (Thus to cancel a drag in a &apos;drop&apos; event you just need to set event.dataTransfer.dropEffect to &quot;none&quot;.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57251</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-23 19:12:59 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: See comment 8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57252</commentid>
    <comment_count>10</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-09-23 19:14:29 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6572.
Check-in comment: Explicitly mention when to render drag-cancel feedback.
http://html5.org/tools/web-apps-tracker?from=6571&amp;to=6572</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>