hixie: drag-and-drop: handle drags to text fields properly (whatwg r4280)

hixie: drag-and-drop: handle drags to text fields properly (whatwg
r4280)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3420&r2=1.3421&f=h
http://html5.org/tools/web-apps-tracker?from=4279&to=4280

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3420
retrieving revision 1.3421
diff -u -d -r1.3420 -r1.3421
--- Overview.html 23 Oct 2009 00:50:21 -0000 1.3420
+++ Overview.html 23 Oct 2009 02:15:10 -0000 1.3421
@@ -51544,42 +51544,54 @@
       element</a>, then the <a href="#current-target-element">current target element</a> must
       be updated, as follows:</p>
 
-      <ol><li>
-
-        <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>
+      <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>
 
-       <li>
+       <dd><p>The user agent must set the <a href="#current-target-element">current target
+       element</a> to the same value.</dd>
 
-        <p>Otherwise, 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>
+       <dt>Otherwise</dt>
 
-       </li>
+       <dd>
 
-       <li>
+        <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>
 
         <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>
 
@@ -51598,11 +51610,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>
@@ -51699,13 +51726,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>

Received on Friday, 23 October 2009 02:26:04 UTC