<?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>17773</bug_id>
          
          <creation_ts>2012-07-13 18:32:58 +0000</creation_ts>
          <short_desc>Drag-and-drop / undo manager interaction</short_desc>
          <delta_ts>2016-04-19 22:25:34 +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>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>rniwa</cc>
    
    <cc>travil</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>69949</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-13 18:32:58 +0000</bug_when>
    <thetext>This was was cloned from bug 14337 as part of operation convergence.
Originally filed: 2011-09-30 00:34:00 +0000
Original reporter: Ian &apos;Hixie&apos; Hickson &lt;ian@hixie.ch&gt;

================================================================================
 #0   Ian &apos;Hixie&apos; Hickson                             2011-09-30 00:34:04 +0000 
--------------------------------------------------------------------------------
HASH(0x2d9df90)
================================================================================
 #1   Ian &apos;Hixie&apos; Hickson                             2011-09-30 00:35:45 +0000 
--------------------------------------------------------------------------------
Ryosuke, can you advise regarding what should be done about the red text here?:

http://www.whatwg.org/specs/web-apps/current-work/complete.html#initiate-the-drag-and-drop-operation

How do I adjust the text to work with your new model?
================================================================================
 #2   Ryosuke Niwa                                    2011-09-30 21:04:59 +0000 
--------------------------------------------------------------------------------
So I think in step 4.1.3. where it says &quot;Insert the actual data of the first item in the drag data store item list to have a drag data item type string of &quot;text/plain&quot; and a drag data item kind that is Plain Unicode string into the text field or editing host or editable element in a manner consistent with platform-specific conventions (e.g. inserting it at the current mouse cursor position, or inserting it at the end of the field).&quot;

The insertion should be implemented as automatic transaction, and the UA should fire transaction event at the end of the insertion as specified in my working draft.
================================================================================
 #3   Ian &apos;Hixie&apos; Hickson                             2011-10-02 16:39:18 +0000 
--------------------------------------------------------------------------------
It&apos;s more than that, though. Literally every DOM manipulation done to the document between the start of the drag and drop operation and the end of it ends up in the browser&apos;s undo transaction history, at least in IE. that is whether it was done by script, or indeed anything else.
================================================================================
 #4   Ryosuke Niwa                                    2011-10-03 19:02:37 +0000 
--------------------------------------------------------------------------------
(In reply to comment #3)
&gt; It&apos;s more than that, though. Literally every DOM manipulation done to the
&gt; document between the start of the drag and drop operation and the end of it
&gt; ends up in the browser&apos;s undo transaction history, at least in IE. that is
&gt; whether it was done by script, or indeed anything else.

I see. I wasn&apos;t aware of that. I&apos;ll have to look into IE&apos;s and other browser&apos;s behavior fist. When you say every DOM manipulation, does that include those done by scripts as well?
================================================================================
 #5   Ian &apos;Hixie&apos; Hickson                             2011-10-03 19:07:43 +0000 
--------------------------------------------------------------------------------
Yeah. The only ones that can be done that I can think of actually are scripted DOM manipulations, and DOM manipulations that are a direct result of the drag/drop operation&apos;s events&apos; default actions.
================================================================================
 #6   Ryosuke Niwa                                    2011-10-21 04:44:33 +0000 
--------------------------------------------------------------------------------
(In reply to comment #3)
&gt; It&apos;s more than that, though. Literally every DOM manipulation done to the
&gt; document between the start of the drag and drop operation and the end of it
&gt; ends up in the browser&apos;s undo transaction history, at least in IE. that is
&gt; whether it was done by script, or indeed anything else.

I&apos;m not observing this behavior. I&apos;ve tried mutating DOM on dragstart, drop, etc... events but they don&apos;t appear to be included in IE&apos;s undo stack. The change I made just stays in the DOM. Could you elaboarate (perhaps a test case?) what you&apos;re observing?

Or are you referring to the DOM changes made by IE itself?
================================================================================
 #7   Ian &apos;Hixie&apos; Hickson                             2011-10-25 04:57:56 +0000 
--------------------------------------------------------------------------------
As discussed on IRC, I think the mutations I tried were done in setTimeout(). Does that help?

I&apos;m not sure we want to be duplicating this though. It may be that that should be considered a bug.
================================================================================
 #8   Ian &apos;Hixie&apos; Hickson                             2011-10-27 00:03:36 +0000 
--------------------------------------------------------------------------------
I&apos;ve removed the text in question from HTML altogether. Let me know if there&apos;s anything you need changed in the HTML spec with respect to tracking DOM changes for undo when they are done from a timeout during a drag-and-drop, and whether there&apos;s anything I need to do to make the actual user-effected changes during a drag-and-drop (e.g. the moving of a text selection in contenteditable=&quot;&quot;) actually result in the right undo transactions.
================================================================================
 #9   contributor@whatwg.org                          2011-10-27 00:07:47 +0000 
--------------------------------------------------------------------------------
Checked in as WHATWG revision r6770.
Check-in comment: drop the note about the implications of drag-and-drop on undo
http://html5.org/tools/web-apps-tracker?from=6769&amp;to=6770
================================================================================
 #10  Ryosuke Niwa                                    2011-11-10 04:09:49 +0000 
--------------------------------------------------------------------------------
(In reply to comment #7)
&gt; As discussed on IRC, I think the mutations I tried were done in setTimeout().
&gt; Does that help?

Yeah, it appears that MSIE restores any DOM mutations done after dragstart event and immediately before drop event.

&gt; I&apos;m not sure we want to be duplicating this though. It may be that that should
&gt; be considered a bug.

It&apos;s possible that some contents depend on this behavior so I&apos;ll probably bring it up on public-webapps or contact someone at Microsoft before finalizing it.
================================================================================
 #11  Ryosuke Niwa                                    2011-11-10 04:10:16 +0000 
--------------------------------------------------------------------------------
Created attachment 1043
test case

Here&apos;s some test case I used.
================================================================================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121037</commentid>
    <comment_count>1</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2015-06-16 10:14:39 +0000</bug_when>
    <thetext>Making this a higher priority to actively seek more feedback on from implementers and webdevs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125926</commentid>
    <comment_count>2</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2016-04-19 22:25:34 +0000</bug_when>
    <thetext>HTML5.1 Bugzilla Bug Triage: 

Migrated to the HTML GitHub repo: https://github.com/w3c/html/issues/221

If this resolution is not satisfactory, please copy the relevant bug details/proposal into a new issue at the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new where it will be re-triaged. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>