[html5] r5657 - [] (0) Some cleanup to make the drag-and-drop model a bit saner. Final preparati [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Oct 29 16:28:24 PDT 2010


Author: ianh
Date: 2010-10-29 16:28:22 -0700 (Fri, 29 Oct 2010)
New Revision: 5657

Modified:
   complete.html
   index
   source
Log:
[] (0) Some cleanup to make the drag-and-drop model a bit saner. Final preparations for dropzone=''.

Modified: complete.html
===================================================================
--- complete.html	2010-10-29 23:14:39 UTC (rev 5656)
+++ complete.html	2010-10-29 23:28:22 UTC (rev 5657)
@@ -67323,11 +67323,15 @@
          field (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code>
          element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code>
          attribute is in the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
-         <a href=#editable>editable</a> element</dt>
+         <a href=#editable>editable</a> element, and the <a href=#drag-data-store-item-list>drag data store
+         item list</a> has an item with <a href=#the-drag-data-item-type-string>the drag data item
+         type string</a> "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the
+         drag data item kind</a> <i>Plain Unicode string</i></dt>
 
          <dd><p>Set the <a href=#current-target-element>current target element</a> to the
          <a href=#immediate-user-selection>immediate user selection</a> anyway.</dd>
 
+<!-- dropzone -->
 
          <dt>If the <a href=#current-target-element>current target element</a> is
          <a href=#the-body-element>the body element</a></dt>
@@ -67380,12 +67384,17 @@
        (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code> element
        whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in
        the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
-       <a href=#editable>editable</a> element</dt>
+       <a href=#editable>editable</a> element, and the <a href=#drag-data-store-item-list>drag data store
+       item list</a> has an item with <a href=#the-drag-data-item-type-string>the drag data item type
+       string</a> "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the drag data
+       item kind</a> <i>Plain Unicode string</i></dt>
 
        <dd><p>Set the <a href=#current-drag-operation>current drag operation</a> to either
        "<code title="">copy</code>" or "<code title="">move</code>",
        as appropriate given the platform conventions.</dd>
 
+<!--dropzone-->
+
        <dt>Otherwise</dt>
 
        <dd><p>Reset the <a href=#current-drag-operation>current drag operation</a> to "<code title="">none</code>".</dd>
@@ -67412,10 +67421,23 @@
         <td>"<code title="">move</code>"</td>
        <tr><td colspan=2>Any other case</td>
         <td>"<code title="">none</code>"</td>
-       </table><p>Then, regardless of whether the <code title=event-dragover><a href=#event-dragover>dragover</a></code> event was canceled or
-      not, update the drag feedback (e.g. the mouse cursor) to match
-      the <a href=#current-drag-operation>current drag operation</a>, as follows:</p>
+       </table></li>
 
+     <li>
+
+      <p>Otherwise, if the <a href=#current-target-element>current target element</a> is not
+      a DOM element, use platform-specific mechanisms to determine
+      what drag operation is being performed (none, copy, link, or
+      move), and set the <i><a href=#current-drag-operation>current drag operation</a></i>
+      accordingly.</p>
+
+     </li>
+
+     <li>
+
+      <p>Update the drag feedback (e.g. the mouse cursor) to match the
+      <a href=#current-drag-operation>current drag operation</a>, as follows:</p>
+
       <table><thead><tr><th>Drag operation</th>
          <th>Feedback</th>
         </thead><tr><td>"<code title="">copy</code>"</td>
@@ -67428,16 +67450,6 @@
         <td>No operation allowed, dropping here will cancel the drag-and-drop operation.</td>
        </table></li>
 
-     <li>
-
-      <p>Otherwise, if the <a href=#current-target-element>current target element</a> is not
-      a DOM element, use platform-specific mechanisms to determine
-      what drag operation is being performed (none, copy, link, or
-      move), and set the <i><a href=#current-drag-operation>current drag operation</a></i>
-      accordingly.</p>
-
-     </li>
-
     </ol></li>
 
    <li>
@@ -67482,20 +67494,23 @@
         default action, which depends on the exact target as
         follows:</p>
 
-        <dl class=switch><dt>If the <a href=#current-target-element>current target element</a> is a text field
-         (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code> element
-         whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in
-         the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
-         <a href=#editable>editable</a> element</dt>
+        <dl class=switch><dt>If the <a href=#current-target-element>current target element</a> is a text
+         field (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code>
+         element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code>
+         attribute is in the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
+         <a href=#editable>editable</a> element, and the <a href=#drag-data-store-item-list>drag data store
+         item list</a> has an item with <a href=#the-drag-data-item-type-string>the drag data item
+         type string</a> "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the
+         drag data item kind</a> <i>Plain Unicode string</i></dt>
 
-         <dd><p>If the <a href=#drag-data-store-item-list>drag data store item list</a> has an
-         item with <a href=#the-drag-data-item-type-string>the drag data item type string</a>
-         "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the drag data item
-         kind</a> <i>Plain Unicode string</i>, insert the actual data
-         of that item into the text field or <a href=#editable>editable</a>
-         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).</dd>
+         <dd><p>Insert the actual data of the first item in the
+         <a href=#drag-data-store-item-list>drag data store item list</a> to have <a href=#the-drag-data-item-type-string title="the drag data item type string">a drag data item type
+         string</a> of "<code>text/plain</code>" and <a href=#the-drag-data-item-kind title="the drag data item kind">a drag data item kind</a>
+         that is <i>Plain Unicode string</i> into the text field or
+         <a href=#editable>editable</a> 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).</dd>
 
          <dt>Otherwise</dt>
 
@@ -67647,11 +67662,6 @@
 
   <h4 id=the-draggable-attribute><span class=secno>8.7.7 </span>The <dfn title=attr-draggable><code>draggable</code></dfn> attribute</h4>
 
-<!--
-XXX DND WIP plan:
- 5. add dropzone="..." feature
--->
-
   <p>All <a href=#html-elements>HTML elements</a> may have the <code title=attr-draggable><a href=#the-draggable-attribute>draggable</a></code> content attribute set. The
   <code title=attr-draggable><a href=#the-draggable-attribute>draggable</a></code> attribute is an
   <a href=#enumerated-attribute>enumerated attribute</a>. It has three states. The first
@@ -67710,6 +67720,12 @@
 
 
 <!--
+XXX DND WIP plan:
+ 5. add dropzone="..." feature
+-->
+
+
+<!--
   <h4>Copy and paste</h4>
 
   <p>Copy-and-paste is a form of drag-and-drop: the "copy" part is

Modified: index
===================================================================
--- index	2010-10-29 23:14:39 UTC (rev 5656)
+++ index	2010-10-29 23:28:22 UTC (rev 5657)
@@ -67329,11 +67329,15 @@
          field (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code>
          element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code>
          attribute is in the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
-         <a href=#editable>editable</a> element</dt>
+         <a href=#editable>editable</a> element, and the <a href=#drag-data-store-item-list>drag data store
+         item list</a> has an item with <a href=#the-drag-data-item-type-string>the drag data item
+         type string</a> "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the
+         drag data item kind</a> <i>Plain Unicode string</i></dt>
 
          <dd><p>Set the <a href=#current-target-element>current target element</a> to the
          <a href=#immediate-user-selection>immediate user selection</a> anyway.</dd>
 
+<!-- dropzone -->
 
          <dt>If the <a href=#current-target-element>current target element</a> is
          <a href=#the-body-element>the body element</a></dt>
@@ -67386,12 +67390,17 @@
        (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code> element
        whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in
        the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
-       <a href=#editable>editable</a> element</dt>
+       <a href=#editable>editable</a> element, and the <a href=#drag-data-store-item-list>drag data store
+       item list</a> has an item with <a href=#the-drag-data-item-type-string>the drag data item type
+       string</a> "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the drag data
+       item kind</a> <i>Plain Unicode string</i></dt>
 
        <dd><p>Set the <a href=#current-drag-operation>current drag operation</a> to either
        "<code title="">copy</code>" or "<code title="">move</code>",
        as appropriate given the platform conventions.</dd>
 
+<!--dropzone-->
+
        <dt>Otherwise</dt>
 
        <dd><p>Reset the <a href=#current-drag-operation>current drag operation</a> to "<code title="">none</code>".</dd>
@@ -67418,10 +67427,23 @@
         <td>"<code title="">move</code>"</td>
        <tr><td colspan=2>Any other case</td>
         <td>"<code title="">none</code>"</td>
-       </table><p>Then, regardless of whether the <code title=event-dragover><a href=#event-dragover>dragover</a></code> event was canceled or
-      not, update the drag feedback (e.g. the mouse cursor) to match
-      the <a href=#current-drag-operation>current drag operation</a>, as follows:</p>
+       </table></li>
 
+     <li>
+
+      <p>Otherwise, if the <a href=#current-target-element>current target element</a> is not
+      a DOM element, use platform-specific mechanisms to determine
+      what drag operation is being performed (none, copy, link, or
+      move), and set the <i><a href=#current-drag-operation>current drag operation</a></i>
+      accordingly.</p>
+
+     </li>
+
+     <li>
+
+      <p>Update the drag feedback (e.g. the mouse cursor) to match the
+      <a href=#current-drag-operation>current drag operation</a>, as follows:</p>
+
       <table><thead><tr><th>Drag operation</th>
          <th>Feedback</th>
         </thead><tr><td>"<code title="">copy</code>"</td>
@@ -67434,16 +67456,6 @@
         <td>No operation allowed, dropping here will cancel the drag-and-drop operation.</td>
        </table></li>
 
-     <li>
-
-      <p>Otherwise, if the <a href=#current-target-element>current target element</a> is not
-      a DOM element, use platform-specific mechanisms to determine
-      what drag operation is being performed (none, copy, link, or
-      move), and set the <i><a href=#current-drag-operation>current drag operation</a></i>
-      accordingly.</p>
-
-     </li>
-
     </ol></li>
 
    <li>
@@ -67488,20 +67500,23 @@
         default action, which depends on the exact target as
         follows:</p>
 
-        <dl class=switch><dt>If the <a href=#current-target-element>current target element</a> is a text field
-         (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code> element
-         whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in
-         the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
-         <a href=#editable>editable</a> element</dt>
+        <dl class=switch><dt>If the <a href=#current-target-element>current target element</a> is a text
+         field (e.g. <code><a href=#the-textarea-element>textarea</a></code>, or an <code><a href=#the-input-element>input</a></code>
+         element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code>
+         attribute is in the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state) or an
+         <a href=#editable>editable</a> element, and the <a href=#drag-data-store-item-list>drag data store
+         item list</a> has an item with <a href=#the-drag-data-item-type-string>the drag data item
+         type string</a> "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the
+         drag data item kind</a> <i>Plain Unicode string</i></dt>
 
-         <dd><p>If the <a href=#drag-data-store-item-list>drag data store item list</a> has an
-         item with <a href=#the-drag-data-item-type-string>the drag data item type string</a>
-         "<code>text/plain</code>" and <a href=#the-drag-data-item-kind>the drag data item
-         kind</a> <i>Plain Unicode string</i>, insert the actual data
-         of that item into the text field or <a href=#editable>editable</a>
-         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).</dd>
+         <dd><p>Insert the actual data of the first item in the
+         <a href=#drag-data-store-item-list>drag data store item list</a> to have <a href=#the-drag-data-item-type-string title="the drag data item type string">a drag data item type
+         string</a> of "<code>text/plain</code>" and <a href=#the-drag-data-item-kind title="the drag data item kind">a drag data item kind</a>
+         that is <i>Plain Unicode string</i> into the text field or
+         <a href=#editable>editable</a> 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).</dd>
 
          <dt>Otherwise</dt>
 
@@ -67653,11 +67668,6 @@
 
   <h4 id=the-draggable-attribute><span class=secno>8.7.7 </span>The <dfn title=attr-draggable><code>draggable</code></dfn> attribute</h4>
 
-<!--
-XXX DND WIP plan:
- 5. add dropzone="..." feature
--->
-
   <p>All <a href=#html-elements>HTML elements</a> may have the <code title=attr-draggable><a href=#the-draggable-attribute>draggable</a></code> content attribute set. The
   <code title=attr-draggable><a href=#the-draggable-attribute>draggable</a></code> attribute is an
   <a href=#enumerated-attribute>enumerated attribute</a>. It has three states. The first
@@ -67716,6 +67726,12 @@
 
 
 <!--
+XXX DND WIP plan:
+ 5. add dropzone="..." feature
+-->
+
+
+<!--
   <h4>Copy and paste</h4>
 
   <p>Copy-and-paste is a form of drag-and-drop: the "copy" part is

Modified: source
===================================================================
--- source	2010-10-29 23:14:39 UTC (rev 5656)
+++ source	2010-10-29 23:28:22 UTC (rev 5657)
@@ -76776,11 +76776,15 @@
          element whose <code title="attr-input-type">type</code>
          attribute is in the <span
          title="attr-input-type-text">Text</span> state) or an
-         <span>editable</span> element</dt>
+         <span>editable</span> element, and the <span>drag data store
+         item list</span> has an item with <span>the drag data item
+         type string</span> "<code>text/plain</code>" and <span>the
+         drag data item kind</span> <i>Plain Unicode string</i></dt>
 
          <dd><p>Set the <span>current target element</span> to the
          <span>immediate user selection</span> anyway.</p></dd>
 
+<!-- dropzone -->
 
          <dt>If the <span>current target element</span> is
          <span>the body element</span></dt>
@@ -76842,12 +76846,17 @@
        (e.g. <code>textarea</code>, or an <code>input</code> element
        whose <code title="attr-input-type">type</code> attribute is in
        the <span title="attr-input-type-text">Text</span> state) or an
-       <span>editable</span> element</dt>
+       <span>editable</span> element, and the <span>drag data store
+       item list</span> has an item with <span>the drag data item type
+       string</span> "<code>text/plain</code>" and <span>the drag data
+       item kind</span> <i>Plain Unicode string</i></dt>
 
        <dd><p>Set the <span>current drag operation</span> to either
        "<code title="">copy</code>" or "<code title="">move</code>",
        as appropriate given the platform conventions.</p></dd>
 
+<!--dropzone-->
+
        <dt>Otherwise</dt>
 
        <dd><p>Reset the <span>current drag operation</span> to "<code
@@ -76895,11 +76904,23 @@
        </tr>
       </table>
 
-      <p>Then, regardless of whether the <code
-      title="event-dragover">dragover</code> event was canceled or
-      not, update the drag feedback (e.g. the mouse cursor) to match
-      the <span>current drag operation</span>, as follows:</p>
+     </li>
 
+     <li>
+
+      <p>Otherwise, if the <span>current target element</span> is not
+      a DOM element, use platform-specific mechanisms to determine
+      what drag operation is being performed (none, copy, link, or
+      move), and set the <i>current drag operation</i>
+      accordingly.</p>
+
+     </li>
+
+     <li>
+
+      <p>Update the drag feedback (e.g. the mouse cursor) to match the
+      <span>current drag operation</span>, as follows:</p>
+
       <table>
        <thead>
         <tr>
@@ -76927,16 +76948,6 @@
 
      </li>
 
-     <li>
-
-      <p>Otherwise, if the <span>current target element</span> is not
-      a DOM element, use platform-specific mechanisms to determine
-      what drag operation is being performed (none, copy, link, or
-      move), and set the <i>current drag operation</i>
-      accordingly.</p>
-
-     </li>
-
     </ol>
 
    </li>
@@ -76998,20 +77009,26 @@
 
         <dl class="switch">
 
-         <dt>If the <span>current target element</span> is a text field
-         (e.g. <code>textarea</code>, or an <code>input</code> element
-         whose <code title="attr-input-type">type</code> attribute is in
-         the <span title="attr-input-type-text">Text</span> state) or an
-         <span>editable</span> element</dt>
+         <dt>If the <span>current target element</span> is a text
+         field (e.g. <code>textarea</code>, or an <code>input</code>
+         element whose <code title="attr-input-type">type</code>
+         attribute is in the <span
+         title="attr-input-type-text">Text</span> state) or an
+         <span>editable</span> element, and the <span>drag data store
+         item list</span> has an item with <span>the drag data item
+         type string</span> "<code>text/plain</code>" and <span>the
+         drag data item kind</span> <i>Plain Unicode string</i></dt>
 
-         <dd><p>If the <span>drag data store item list</span> has an
-         item with <span>the drag data item type string</span>
-         "<code>text/plain</code>" and <span>the drag data item
-         kind</span> <i>Plain Unicode string</i>, insert the actual data
-         of that item into the text field or <span>editable</span>
-         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).</p></dd>
+         <dd><p>Insert the actual data of the first item in the
+         <span>drag data store item list</span> to have <span
+         title="the drag data item type string">a drag data item type
+         string</span> of "<code>text/plain</code>" and <span
+         title="the drag data item kind">a drag data item kind</span>
+         that is <i>Plain Unicode string</i> into the text field or
+         <span>editable</span> 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).</p></dd>
 
          <dt>Otherwise</dt>
 
@@ -77210,11 +77227,6 @@
 
   <h4>The <dfn title="attr-draggable"><code>draggable</code></dfn> attribute</h4>
 
-<!--
-XXX DND WIP plan:
- 5. add dropzone="..." feature
--->
-
   <p>All <span>HTML elements</span> may have the <code
   title="attr-draggable">draggable</code> content attribute set. The
   <code title="attr-draggable">draggable</code> attribute is an
@@ -77289,6 +77301,12 @@
 
 
 <!--
+XXX DND WIP plan:
+ 5. add dropzone="..." feature
+-->
+
+
+<!--
   <h4>Copy and paste</h4>
 
   <p>Copy-and-paste is a form of drag-and-drop: the "copy" part is




More information about the Commit-Watchers mailing list