<?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>14337</bug_id>
          
          <creation_ts>2011-09-30 00:34:04 +0000</creation_ts>
          <short_desc>Drag-and-drop / undo manager interaction</short_desc>
          <delta_ts>2016-03-25 05:08:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ian &apos;Hixie&apos; Hickson">ian</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>rniwa</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57541</commentid>
    <comment_count>0</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-30 00:34:04 +0000</bug_when>
    <thetext></thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57542</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-30 00:35:45 +0000</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57598</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-09-30 21:04:59 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57639</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-02 16:39:18 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57720</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-10-03 19:02:37 +0000</bug_when>
    <thetext>(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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57722</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-03 19:07:43 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58618</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-10-21 04:44:33 +0000</bug_when>
    <thetext>(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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58863</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-25 04:57:56 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59033</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-27 00:03:36 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59035</commentid>
    <comment_count>9</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-27 00:07:47 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59815</commentid>
    <comment_count>10</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-11-10 04:09:49 +0000</bug_when>
    <thetext>(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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59816</commentid>
    <comment_count>11</comment_count>
      <attachid>1043</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-11-10 04:10:16 +0000</bug_when>
    <thetext>Created attachment 1043
test case

Here&apos;s some test case I used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69950</commentid>
    <comment_count>12</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-13 18:33:02 +0000</bug_when>
    <thetext>This bug was cloned to create bug 17773 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123103</commentid>
    <comment_count>13</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-09-05 17:54:22 +0000</bug_when>
    <thetext>Ryosuke, you stopped working on undo manager, right? Given that, and given that the red text from comment 1 appears to be gone. Can I close this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123113</commentid>
    <comment_count>14</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2015-09-06 23:04:12 +0000</bug_when>
    <thetext>Yeah, I did when I left Google. However, I&apos;ve been told that someone from Google is still interested in maintaining the spec. Try contacting slightlyoff?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125623</commentid>
    <comment_count>15</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-25 05:08:05 +0000</bug_when>
    <thetext>I asked Alex, he said this stopped being developed when you left.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1043</attachid>
            <date>2011-11-10 04:10:16 +0000</date>
            <delta_ts>2011-11-10 04:10:16 +0000</delta_ts>
            <desc>test case</desc>
            <filename>drag-test.html</filename>
            <type>text/html</type>
            <size>462</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KPGRpdiBpZD0idGVzdCIgb25kcmFnc3Rh
cnQ9IihmdW5jdGlvbigpe2RvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdzb21lMicpLnRleHRDb250
ZW50ID0gJ3ZhbHVlMic7DQpkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnc29tZTMnKS50ZXh0Q29u
dGVudCA9ICd2YWx1ZTInO30pKCk7Ig0Kb25kcm9wPSIoZnVuY3Rpb24oKXtkb2N1bWVudC5nZXRF
bGVtZW50QnlJZCgnc29tZTNiJykudGV4dENvbnRlbnQgPSAndmFsdWUyJzt9KSgpOyINCmNvbnRl
bnRlZGl0YWJsZT5oZWxsbyB3b3JsZCA8YiBpZD0ic29tZSI+ZHJhZzwvYj4gbWUNCjxwIGlkPSJz
b21lMiI+dmFsdWUxPC9wPjxwIGlkPSJzb21lMmIiPnZhbHVlMTwvcD4NCjwvZGl2Pg0KPHAgaWQ9
InNvbWUzIj52YWx1ZTE8L3A+PHAgaWQ9InNvbWUzYiI+dmFsdWUxPC9wPg0KPC9ib2R5Pg0KPC9o
dG1sPg0K
</data>

          </attachment>
      

    </bug>

</bugzilla>