[html5] r4280 - [giow] (1) drag-and-drop: handle drags to text fields properly

whatwg at whatwg.org whatwg at whatwg.org
Thu Oct 22 19:28:19 PDT 2009


Author: ianh
Date: 2009-10-22 19:28:15 -0700 (Thu, 22 Oct 2009)
New Revision: 4280

Modified:
   complete.html
   index
   source
Log:
[giow] (1) drag-and-drop: handle drags to text fields properly

Modified: complete.html
===================================================================
--- complete.html	2009-10-23 01:02:56 UTC (rev 4279)
+++ complete.html	2009-10-23 02:28:15 UTC (rev 4280)
@@ -61993,43 +61993,55 @@
       element</a>, then the <a href=#current-target-element>current target element</a> must
       be updated, as follows:</p>
 
-      <ol><li>
+      <dl class=switch><dt>If the new <a href=#immediate-user-selection>immediate user selection</a> is null, or
+       is in a non-DOM document or application</dt>
 
-        <p>If the new <a href=#immediate-user-selection>immediate user selection</a> is null, or
-        is in a non-DOM document or application, then set the
-        <a href=#current-target-element>current target element</a> to the same value.</p>
+       <dd><p>The user agent must set the <a href=#current-target-element>current target
+       element</a> to the same value.</dd>
 
-       <li>
+       <dt>Otherwise</dt>
 
-        <p>Otherwise, the user agent must fire a <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at the
+       <dd>
+
+        <p>The user agent must fire a <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at the
         <a href=#immediate-user-selection>immediate user selection</a>.</p>
 
-       </li>
-
-       <li>
-
         <p>If the event is canceled, then the <a href=#current-target-element>current target
         element</a> must be set to the <a href=#immediate-user-selection>immediate user
         selection</a>.</p>
 
-       </li>
+        <p>Otherwise, the user agent must act as follows:</p>
 
-       <li>
+        <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>
 
-        <p>Otherwise, if the <a href=#current-target-element>current target element</a> is
-        not <a href=#the-body-element>the body element</a>, the user agent must fire a
-        <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at
-        <a href=#the-body-element>the body element</a>, and the <a href=#current-target-element>current target
-        element</a> must be set to <a href=#the-body-element>the body element</a>,
-        regardless of whether that event was canceled or not. (If
-        <a href=#the-body-element>the body element</a> is null, then the <a href=#current-target-element>current
-        target element</a> would be set to null too in this case,
-        it wouldn't be set to the <code>Document</code> object.)</p>
+         <dd><p>The <a href=#current-target-element>current target element</a> must be set to
+         the <a href=#immediate-user-selection>immediate user selection</a> anyway.</dd>
 
-       </li>
+         <dt>If the <a href=#current-target-element>current target element</a> is 
+         <a href=#the-body-element>the body element</a></dt>
 
-      </ol></li>
+         <dd><p>The <a href=#current-target-element>current target element</a> is left
+         unchanged.</dd>
 
+         <dt>Otherwise</dt>
+         
+         <dd><p>The user agent must fire a <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at <a href=#the-body-element>the
+         body element</a>, and the <a href=#current-target-element>current target
+         element</a> must be set to <a href=#the-body-element>the body element</a>,
+         regardless of whether that event was canceled or not. (If
+         <a href=#the-body-element>the body element</a> is null, then the <a href=#current-target-element>current
+         target element</a> would be set to null too in this case,
+         it wouldn't be set to the <code>Document</code>
+         object.)</dd>
+
+        </dl></dd>
+
+      </dl></li>
+
      <li>
 
       <p>If the previous step caused the <a href=#current-target-element>current target
@@ -62047,11 +62059,26 @@
       target element</a>.</p>
 
       <p>If the <code title=event-dragover><a href=#event-dragover>dragover</a></code> event is
-      not canceled, the <a href=#current-drag-operation>current drag operation</a> must be
-      reset to "none".</p>
+      not canceled, the user agent must act as follows:</p>
 
-      <p>Otherwise, the <a href=#current-drag-operation>current drag operation</a> must be
-      set based on the values the <code title=dom-DataTransfer-effectAllowed><a href=#dom-datatransfer-effectallowed>effectAllowed</a></code> and
+      <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>
+
+       <dd><p>The user agent must set the <a href=#current-drag-operation>current drag
+       operation</a> to either "copy" or "move", as appropriate
+       given the platform conventions.</dd>
+
+       <dt>Otherwise</dt>
+
+       <dd><p>The user agent must reset the <a href=#current-drag-operation>current drag
+       operation</a> to "none".</dd>
+
+      </dl><p>Otherwise (if the <code title=event-dragover><a href=#event-dragover>dragover</a></code> event <em>is</em>
+      canceled), the <a href=#current-drag-operation>current drag operation</a> must be set
+      based on the values the <code title=dom-DataTransfer-effectAllowed><a href=#dom-datatransfer-effectallowed>effectAllowed</a></code> and
       <code title=dom-DataTransfer-dropEffect><a href=#dom-datatransfer-dropeffect>dropEffect</a></code>
       attributes of the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> object
       had after the event was handled, as per the following table:</p>
@@ -62148,13 +62175,15 @@
       <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)</dt>
+       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>
 
        <dd>The user agent must insert the data associated with the
-       <code>text/plain</code> format, if any, into the text field 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>
+       <code>text/plain</code> format, if any, 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>
 

Modified: index
===================================================================
--- index	2009-10-23 01:02:56 UTC (rev 4279)
+++ index	2009-10-23 02:28:15 UTC (rev 4280)
@@ -57506,43 +57506,55 @@
       element</a>, then the <a href=#current-target-element>current target element</a> must
       be updated, as follows:</p>
 
-      <ol><li>
+      <dl class=switch><dt>If the new <a href=#immediate-user-selection>immediate user selection</a> is null, or
+       is in a non-DOM document or application</dt>
 
-        <p>If the new <a href=#immediate-user-selection>immediate user selection</a> is null, or
-        is in a non-DOM document or application, then set the
-        <a href=#current-target-element>current target element</a> to the same value.</p>
+       <dd><p>The user agent must set the <a href=#current-target-element>current target
+       element</a> to the same value.</dd>
 
-       <li>
+       <dt>Otherwise</dt>
 
-        <p>Otherwise, the user agent must fire a <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at the
+       <dd>
+
+        <p>The user agent must fire a <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at the
         <a href=#immediate-user-selection>immediate user selection</a>.</p>
 
-       </li>
-
-       <li>
-
         <p>If the event is canceled, then the <a href=#current-target-element>current target
         element</a> must be set to the <a href=#immediate-user-selection>immediate user
         selection</a>.</p>
 
-       </li>
+        <p>Otherwise, the user agent must act as follows:</p>
 
-       <li>
+        <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>
 
-        <p>Otherwise, if the <a href=#current-target-element>current target element</a> is
-        not <a href=#the-body-element>the body element</a>, the user agent must fire a
-        <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at
-        <a href=#the-body-element>the body element</a>, and the <a href=#current-target-element>current target
-        element</a> must be set to <a href=#the-body-element>the body element</a>,
-        regardless of whether that event was canceled or not. (If
-        <a href=#the-body-element>the body element</a> is null, then the <a href=#current-target-element>current
-        target element</a> would be set to null too in this case,
-        it wouldn't be set to the <code>Document</code> object.)</p>
+         <dd><p>The <a href=#current-target-element>current target element</a> must be set to
+         the <a href=#immediate-user-selection>immediate user selection</a> anyway.</dd>
 
-       </li>
+         <dt>If the <a href=#current-target-element>current target element</a> is 
+         <a href=#the-body-element>the body element</a></dt>
 
-      </ol></li>
+         <dd><p>The <a href=#current-target-element>current target element</a> is left
+         unchanged.</dd>
 
+         <dt>Otherwise</dt>
+         
+         <dd><p>The user agent must fire a <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> event at <a href=#the-body-element>the
+         body element</a>, and the <a href=#current-target-element>current target
+         element</a> must be set to <a href=#the-body-element>the body element</a>,
+         regardless of whether that event was canceled or not. (If
+         <a href=#the-body-element>the body element</a> is null, then the <a href=#current-target-element>current
+         target element</a> would be set to null too in this case,
+         it wouldn't be set to the <code>Document</code>
+         object.)</dd>
+
+        </dl></dd>
+
+      </dl></li>
+
      <li>
 
       <p>If the previous step caused the <a href=#current-target-element>current target
@@ -57560,11 +57572,26 @@
       target element</a>.</p>
 
       <p>If the <code title=event-dragover><a href=#event-dragover>dragover</a></code> event is
-      not canceled, the <a href=#current-drag-operation>current drag operation</a> must be
-      reset to "none".</p>
+      not canceled, the user agent must act as follows:</p>
 
-      <p>Otherwise, the <a href=#current-drag-operation>current drag operation</a> must be
-      set based on the values the <code title=dom-DataTransfer-effectAllowed><a href=#dom-datatransfer-effectallowed>effectAllowed</a></code> and
+      <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>
+
+       <dd><p>The user agent must set the <a href=#current-drag-operation>current drag
+       operation</a> to either "copy" or "move", as appropriate
+       given the platform conventions.</dd>
+
+       <dt>Otherwise</dt>
+
+       <dd><p>The user agent must reset the <a href=#current-drag-operation>current drag
+       operation</a> to "none".</dd>
+
+      </dl><p>Otherwise (if the <code title=event-dragover><a href=#event-dragover>dragover</a></code> event <em>is</em>
+      canceled), the <a href=#current-drag-operation>current drag operation</a> must be set
+      based on the values the <code title=dom-DataTransfer-effectAllowed><a href=#dom-datatransfer-effectallowed>effectAllowed</a></code> and
       <code title=dom-DataTransfer-dropEffect><a href=#dom-datatransfer-dropeffect>dropEffect</a></code>
       attributes of the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> object
       had after the event was handled, as per the following table:</p>
@@ -57661,13 +57688,15 @@
       <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)</dt>
+       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>
 
        <dd>The user agent must insert the data associated with the
-       <code>text/plain</code> format, if any, into the text field 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>
+       <code>text/plain</code> format, if any, 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>
 

Modified: source
===================================================================
--- source	2009-10-23 01:02:56 UTC (rev 4279)
+++ source	2009-10-23 02:28:15 UTC (rev 4280)
@@ -70171,46 +70171,64 @@
       element</span>, then the <span>current target element</span> must
       be updated, as follows:</p>
 
-      <ol>
+      <dl class="switch">
 
-       <li>
+       <dt>If the new <span>immediate user selection</span> is null, or
+       is in a non-DOM document or application</dt>
 
-        <p>If the new <span>immediate user selection</span> is null, or
-        is in a non-DOM document or application, then set the
-        <span>current target element</span> to the same value.</p>
+       <dd><p>The user agent must set the <span>current target
+       element</span> to the same value.</p></dd>
 
-       <li>
+       <dt>Otherwise</dt>
 
-        <p>Otherwise, the user agent must fire a <code
+       <dd>
+
+        <p>The user agent must fire a <code
         title="event-dragenter">dragenter</code> event at the
         <span>immediate user selection</span>.</p>
 
-       </li>
-
-       <li>
-
         <p>If the event is canceled, then the <span>current target
         element</span> must be set to the <span>immediate user
         selection</span>.</p>
 
-       </li>
+        <p>Otherwise, the user agent must act as follows:</p>
 
-       <li>
+        <dl class="switch">
 
-        <p>Otherwise, if the <span>current target element</span> is
-        not <span>the body element</span>, the user agent must fire a
-        <code title="event-dragenter">dragenter</code> event at
-        <span>the body element</span>, and the <span>current target
-        element</span> must be set to <span>the body element</span>,
-        regardless of whether that event was canceled or not. (If
-        <span>the body element</span> is null, then the <span>current
-        target element</span> would be set to null too in this case,
-        it wouldn't be set to the <code>Document</code> object.)</p>
+         <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>
 
-       </li>
+         <dd><p>The <span>current target element</span> must be set to
+         the <span>immediate user selection</span> anyway.</p></dd>
 
-      </ol>
+         <dt>If the <span>current target element</span> is 
+         <span>the body element</span></dt>
 
+         <dd><p>The <span>current target element</span> is left
+         unchanged.</p></dd>
+
+         <dt>Otherwise</dt>
+         
+         <dd><p>The user agent must fire a <code
+         title="event-dragenter">dragenter</code> event at <span>the
+         body element</span>, and the <span>current target
+         element</span> must be set to <span>the body element</span>,
+         regardless of whether that event was canceled or not. (If
+         <span>the body element</span> is null, then the <span>current
+         target element</span> would be set to null too in this case,
+         it wouldn't be set to the <code>Document</code>
+         object.)</p></dd>
+
+        </dl>
+
+       </dd>
+
+      </dl>
+
      </li>
 
      <li>
@@ -70231,11 +70249,31 @@
       target element</span>.</p>
 
       <p>If the <code title="event-dragover">dragover</code> event is
-      not canceled, the <span>current drag operation</span> must be
-      reset to "none".</p>
+      not canceled, the user agent must act as follows:</p>
 
-      <p>Otherwise, the <span>current drag operation</span> must be
-      set based on the values the <code
+      <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>
+
+       <dd><p>The user agent must set the <span>current drag
+       operation</span> to either "copy" or "move", as appropriate
+       given the platform conventions.</p></dd>
+
+       <dt>Otherwise</dt>
+
+       <dd><p>The user agent must reset the <span>current drag
+       operation</span> to "none".</p></dd>
+
+      </dl>
+
+      <p>Otherwise (if the <code
+      title="event-dragover">dragover</code> event <em>is</em>
+      canceled), the <span>current drag operation</span> must be set
+      based on the values the <code
       title="dom-DataTransfer-effectAllowed">effectAllowed</code> and
       <code title="dom-DataTransfer-dropEffect">dropEffect</code>
       attributes of the <code
@@ -70380,13 +70418,15 @@
        <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)</dt>
+       the <span title="attr-input-type-text">Text</span> state) or an
+       <span>editable</span> element</dt>
 
        <dd>The user agent must insert the data associated with the
-       <code>text/plain</code> format, if any, into the text field 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>
+       <code>text/plain</code> format, if any, 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).</dd>
 
        <dt>Otherwise</dt>
 




More information about the Commit-Watchers mailing list