html5/spec Overview.html,1.3698,1.3699

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv27479

Modified Files:
	Overview.html 
Log Message:
Make the drag-and-drop API lowercase all the format strings. (whatwg r4645)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3698
retrieving revision 1.3699
diff -u -d -r1.3698 -r1.3699
--- Overview.html	4 Feb 2010 01:43:40 -0000	1.3698
+++ Overview.html	4 Feb 2010 02:29:13 -0000	1.3699
@@ -47660,6 +47660,20 @@
 
        Ack: Ben Laurie (@g)
 
+     * Promises. Should be able to say "if you accept this drop, then
+       I can provide the File object that corresponds to it
+       eventually".
+
+     * Exposing more information about each item. Best idea (from
+       Eduard Pascual) is to have a new attribute on dataTransfer
+       that's a list of items, each of which has:
+
+           .kind = text data, File data, promise
+           .type = a MIME type
+           .getData(callback) = calls the callback once the data is available
+           .setData(value) = replace the value
+           .remove() = removes the entry
+
 --><p>This section defines an event-based drag-and-drop mechanism.<p>This specification does not define exactly what a
   <em>drag-and-drop operation</em> actually is.<p>On a visual medium with a pointing device, a drag operation could
   be the default action of a <code title="event-mousedown">mousedown</code> event that is followed by a
@@ -47802,9 +47816,10 @@
 };</pre><p><code><a href="#datatransfer">DataTransfer</a></code> objects can hold pieces of data, each
   associated with a unique format. Formats are generally given by
   <a href="#mime-type" title="MIME type">MIME types</a>, with some values
-  special-cased for legacy reasons. For the purposes of this API,
-  however, the format strings are opaque, <a href="#case-sensitive">case-sensitive</a>,
-  strings, and the empty string is a valid format string.<dl class="domintro"><dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> [ = <var title="">value</var> ]</dt>
+  special-cased for legacy reasons. However, the API does not enforce
+  this; non-MIME-type values can be added as well. All formats are
+  identified by strings that are <a href="#converted-to-ascii-lowercase">converted to ASCII
+  lowercase</a> by the API.<dl class="domintro"><dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> [ = <var title="">value</var> ]</dt>
 
    <dd>
 
@@ -47926,14 +47941,10 @@
   <p>The <dfn id="dom-datatransfer-types" title="dom-DataTransfer-types"><code>types</code></dfn>
   attribute must return a live <code>DOMStringList</code> that
   contains the list of formats that were added to the
-  <code><a href="#datatransfer">DataTransfer</a></code> object in the corresponding <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> event. If any files were
+  <code><a href="#datatransfer">DataTransfer</a></code> object in the corresponding <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> event.  If any files were
   included in the drag, then the <code>DOMStringList</code> object
-  must in addition include the string "<code title="">Files</code>".</p>
-
-  <p class="note">If the <code title="dom-DataTransfer-setData"><a href="#dom-datatransfer-setdata">setData()</a></code> method is invoked
-  with the string "<code title="">Files</code>", and some files were
-  included in the drag, then the string "<code title="">Files</code>"
-  will appear twice in the <code title="dom-DataTransfer-types"><a href="#dom-datatransfer-types">types</a></code> attribute's list.</p>
+  must in addition include the string "<code title="">Files</code>". (This value can be distinguished from the
+  other values because it is not lowercase.)</p>
 
   <p>The <dfn id="dom-datatransfer-cleardata" title="dom-DataTransfer-clearData"><code>clearData()</code></dfn>
   method, when called with no arguments, must clear the
@@ -47947,28 +47958,32 @@
 
   <p>When called with an argument, the <code title="dom-DataTransfer-clearData"><a href="#dom-datatransfer-cleardata">clearData(<var title="">format</var>)</a></code> method must clear the
   <code><a href="#datatransfer">DataTransfer</a></code> object of any data associated with the
-  given <var title="">format</var>. If <var title="">format</var> is
-  the value "<code title="">Text</code>", then it must be treated as
-  "<code title="">text/plain</code>". If the <var title="">format</var> is "<code title="">URL</code>", then it must
-  be treated as "<code title="">text/uri-list</code>".</p>
+  given <var title="">format</var>, <a href="#converted-to-ascii-lowercase">converted to ASCII
+  lowercase</a>. If <var title="">format</var> (after conversion to
+  lowercase) is the value "<code title="">text</code>", then it must
+  be treated as "<code title="">text/plain</code>". If the <var title="">format</var> (after conversion to lowercase) is "<code title="">url</code>", then it must be treated as "<code title="">text/uri-list</code>".</p>
 
   <p>The <dfn id="dom-datatransfer-setdata" title="dom-DataTransfer-setData"><code>setData(<var title="">format</var>, <var title="">data</var>)</code></dfn> method
   must add <var title="">data</var> to the data stored in the
-  <code><a href="#datatransfer">DataTransfer</a></code> object, labeled as being of the type <var title="">format</var>. This must replace any previous data that had
-  been set for that format. If <var title="">format</var> is the value
-  "<code title="">Text</code>", then it must be treated as "<code title="">text/plain</code>". If the <var title="">format</var> is
-  "<code title="">URL</code>", then it must be treated as "<code title="">text/uri-list</code>".</p>
+  <code><a href="#datatransfer">DataTransfer</a></code> object, labeled as being of the type <var title="">format</var>, <a href="#converted-to-ascii-lowercase">converted to ASCII
+  lowercase</a>. This must replace any previous data that had been
+  set for that format. If <var title="">format</var> (after conversion
+  to lowercase) is the value "<code title="">text</code>", then it
+  must be treated as "<code title="">text/plain</code>". If the <var title="">format</var> (after conversion to lowercase) is "<code title="">url</code>", then it must be treated as "<code title="">text/uri-list</code>".</p>
 
   <p>The <dfn id="dom-datatransfer-getdata" title="dom-DataTransfer-getData"><code>getData(<var title="">format</var>)</code></dfn> method must return the data that
-  is associated with the type <var title="">format</var>, if any, and
-  must return the empty string otherwise. If <var title="">format</var> is the value "<code title="">Text</code>",
+  is associated with the type <var title="">format</var>
+  <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>, if any, and must return
+  the empty string otherwise. If <var title="">format</var> (after
+  conversion to lowercase) is the value "<code title="">text</code>",
   then it must be treated as "<code title="">text/plain</code>". If
-  the <var title="">format</var> is "<code title="">URL</code>", then
-  the data associated with the "<code title="">text/uri-list</code>"
-  format must be parsed as appropriate for <code title="">text/uri-list</code> data, and the first URL from the list
-  must be returned. If there is no data with that format, or if there
-  is but it has no URLs, then the method must return the empty
-  string. <a href="#refsRFC2483">[RFC2483]</a></p>
+  the <var title="">format</var> (after conversion to lowercase) is
+  "<code title="">url</code>", then the data associated with the
+  "<code title="">text/uri-list</code>" format must be parsed as
+  appropriate for <code title="">text/uri-list</code> data, and the
+  first URL from the list must be returned. If there is no data with
+  that format, or if there is but it has no URLs, then the method must
+  return the empty string. <a href="#refsRFC2483">[RFC2483]</a></p>
 
   <p>The <dfn id="dom-datatransfer-files" title="dom-DataTransfer-files"><code>files</code></dfn>
   attribute must return the <code>FileList</code> object that contains
@@ -47976,6 +47991,9 @@
   object. There is one such object per <code><a href="#datatransfer">DataTransfer</a></code>
   object.</p>
 
+  <p class="note">This version of the API does not expose the types of
+  the files during the drag.</p>
+
   <p>The <dfn id="dom-datatransfer-setdragimage" title="dom-DataTransfer-setDragImage"><code>setDragImage(<var title="">element</var>, <var title="">x</var>, <var title="">y</var>)</code></dfn> method sets which element to use <a href="#base-dnd-feedback">to generate the drag feedback</a>. The
   <var title="">element</var> argument can be any
   <code>Element</code>; if it is an <code><a href="#the-img-element">img</a></code> element, then the
@@ -48650,6 +48668,10 @@
   user agents must similarly use platform-specific conventions when
   deciding on what drag feedback to use.</p>
 
+  <p>All the format strings must be <a href="#converted-to-ascii-lowercase">converted to ASCII
+  lowercase</a>. If the platform conventions do not use <a href="#mime-type" title="MIME type">MIME types</a> to label the dragged data, the
+  user agent must map the types to MIME types first.</p>
+
   <p>If a drag is started in a document but ends in another
   application, then the user agent must instead replace the parts of
   the processing model relating to handling the <em>target</em>

Received on Thursday, 4 February 2010 02:29:17 UTC