[html5] r1227 - /
whatwg at whatwg.org
whatwg at whatwg.org
Thu Feb 14 16:56:08 PST 2008
Author: ianh
Date: 2008-02-14 16:56:04 -0800 (Thu, 14 Feb 2008)
New Revision: 1227
Modified:
index
source
Log:
[iw] (2) drag-and-drop: add dataTransfer.types; remove the limitation that copy/paste only be for text; remove bogus requirements; add placeholder for intro section
Modified: index
===================================================================
--- index 2008-02-14 21:38:35 UTC (rev 1226)
+++ index 2008-02-15 00:56:04 UTC (rev 1227)
@@ -24,7 +24,7 @@
<h1 id=html-5>HTML 5</h1>
- <h2 class="no-num no-toc" id=working>Working Draft — 14 February
+ <h2 class="no-num no-toc" id=working>Working Draft — 15 February
2008</h2>
<p>You can take part in this work. <a
@@ -1365,42 +1365,45 @@
<li><a href="#dnd"><span class=secno>5.3 </span>Drag and drop</a>
<ul class=toc>
- <li><a href="#the-dragevent"><span class=secno>5.3.1 </span>The
+ <li><a href="#introduction4"><span class=secno>5.3.1
+ </span>Introduction</a>
+
+ <li><a href="#the-dragevent"><span class=secno>5.3.2 </span>The
<code>DragEvent</code> and <code>DataTransfer</code> interfaces</a>
- <li><a href="#events1"><span class=secno>5.3.2 </span>Events fired
+ <li><a href="#events1"><span class=secno>5.3.3 </span>Events fired
during a drag-and-drop action</a>
- <li><a href="#drag-and-drop"><span class=secno>5.3.3
+ <li><a href="#drag-and-drop"><span class=secno>5.3.4
</span>Drag-and-drop processing model</a>
<ul class=toc>
- <li><a href="#when-the"><span class=secno>5.3.3.1. </span>When the
+ <li><a href="#when-the"><span class=secno>5.3.4.1. </span>When the
drag-and-drop operation starts or ends in another document</a>
- <li><a href="#when-the0"><span class=secno>5.3.3.2. </span>When the
+ <li><a href="#when-the0"><span class=secno>5.3.4.2. </span>When the
drag-and-drop operation starts or ends in another application</a>
</ul>
- <li><a href="#the-draggable"><span class=secno>5.3.4 </span>The
+ <li><a href="#the-draggable"><span class=secno>5.3.5 </span>The
<code>draggable</code> attribute</a>
- <li><a href="#copy-and"><span class=secno>5.3.5 </span>Copy and
+ <li><a href="#copy-and"><span class=secno>5.3.6 </span>Copy and
paste</a>
<ul class=toc>
- <li><a href="#copy-to"><span class=secno>5.3.5.1. </span>Copy to
+ <li><a href="#copy-to"><span class=secno>5.3.6.1. </span>Copy to
clipboard</a>
- <li><a href="#cut-to"><span class=secno>5.3.5.2. </span>Cut to
+ <li><a href="#cut-to"><span class=secno>5.3.6.2. </span>Cut to
clipboard</a>
- <li><a href="#paste"><span class=secno>5.3.5.3. </span>Paste from
+ <li><a href="#paste"><span class=secno>5.3.6.3. </span>Paste from
clipboard</a>
- <li><a href="#paste0"><span class=secno>5.3.5.4. </span>Paste from
+ <li><a href="#paste0"><span class=secno>5.3.6.4. </span>Paste from
selection</a>
</ul>
- <li><a href="#security8"><span class=secno>5.3.6 </span>Security risks
+ <li><a href="#security8"><span class=secno>5.3.7 </span>Security risks
in the drag-and-drop model</a>
</ul>
@@ -33226,7 +33229,13 @@
(so if the operation is not canceled, there must be at least one element
in the middle step).
- <h4 id=the-dragevent><span class=secno>5.3.1 </span>The <code><a
+ <h4 id=introduction4><span class=secno>5.3.1 </span>Introduction</h4>
+
+ <p><em>This section is non-normative.</em>
+
+ <p class=big-issue>It's also currently non-existent.
+
+ <h4 id=the-dragevent><span class=secno>5.3.2 </span>The <code><a
href="#dragevent">DragEvent</a></code> and <code><a
href="#datatransfer0">DataTransfer</a></code> interfaces</h4>
@@ -33256,16 +33265,10 @@
of the <code><a href="#dragevent">DragEvent</a></code> interface
represents the context information for the event.
- <p>When a <code><a href="#dragevent">DragEvent</a></code> object is
- created, a new <code><a href="#datatransfer0">DataTransfer</a></code>
- object must be created and assigned to the <code
- title=dom-DragEvent-dataTransfer><a
- href="#datatransfer">dataTransfer</a></code> context information field of
- the event object.
-
<pre class=idl>interface <dfn id=datatransfer0>DataTransfer</dfn> {
attribute DOMString <a href="#dropeffect" title=dom-DataTransfer-dropEffect>dropEffect</a>;
attribute DOMString <a href="#effectallowed" title=dom-DataTransfer-effectAllowed>effectAllowed</a>;
+ readonly attribute DOMStringList <a href="#types" title=dom-DataTransfer-types>types</a>;
void <a href="#cleardata" title=dom-DataTransfer-clearData>clearData</a>(in DOMString format);
void <a href="#setdata" title=dom-DataTransfer-setData>setData</a>(in DOMString format, in DOMString data);
DOMString <a href="#getdata" title=dom-DataTransfer-getData>getData</a>(in DOMString format);
@@ -33277,11 +33280,8 @@
<p><code><a href="#datatransfer0">DataTransfer</a></code> objects can
conceptually contain various kinds of data.
- <p>When a <code><a href="#dragevent">DragEvent</a></code> event object is
- initialised, the <code><a href="#datatransfer0">DataTransfer</a></code>
- object created for the event's <code title=dom-DragEvent-dataTransfer><a
- href="#datatransfer">dataTransfer</a></code> member must be initialised as
- follows:
+ <p>When a <code><a href="#datatransfer0">DataTransfer</a></code> object is
+ created, it must be initialised as follows:
<ul>
<li>The <code><a href="#datatransfer0">DataTransfer</a></code> object must
@@ -33362,6 +33362,11 @@
it has no URIs, then the method must return the empty string. <a
href="#refsRFC2483">[RFC2483]</a>
+ <p>The <dfn id=types title=dom-DataTransfer-types><code>types</code></dfn>
+ attribute must return a live <code>DOMStringList</code> that contains the
+ list of formats that are stored in the <code><a
+ href="#datatransfer0">DataTransfer</a></code> object.
+
<p>The <dfn id=setdragimage
title=dom-DataTransfer-setDragImage><code>setDragImage(<var
title="">element</var>, <var title="">x</var>, <var
@@ -33380,7 +33385,7 @@
the drag feedback</a>. It adds an element to the <code><a
href="#datatransfer0">DataTransfer</a></code> object.
- <h4 id=events1><span class=secno>5.3.2 </span>Events fired during a
+ <h4 id=events1><span class=secno>5.3.3 </span>Events fired during a
drag-and-drop action</h4>
<p>The following events are involved in the drag-and-drop model. Whenever
@@ -33634,7 +33639,7 @@
<td><code title="">copy</code>
</table>
- <h4 id=drag-and-drop><span class=secno>5.3.3 </span>Drag-and-drop
+ <h4 id=drag-and-drop><span class=secno>5.3.4 </span>Drag-and-drop
processing model</h4>
<p>When the user attempts to begin a drag operation, the user agent must
@@ -34072,7 +34077,7 @@
</ol>
</ol>
- <h5 id=when-the><span class=secno>5.3.3.1. </span>When the drag-and-drop
+ <h5 id=when-the><span class=secno>5.3.4.1. </span>When the drag-and-drop
operation starts or ends in another document</h5>
<p>The model described above is independent of which <code>Document</code>
@@ -34083,7 +34088,7 @@
source in the events to the target, or is that obvious enough from
the requirements in the event section above? -->
- <h5 id=when-the0><span class=secno>5.3.3.2. </span>When the drag-and-drop
+ <h5 id=when-the0><span class=secno>5.3.4.2. </span>When the drag-and-drop
operation starts or ends in another application</h5>
<p>If the drag is initiated in another application, the <a
@@ -34107,7 +34112,7 @@
ended in another application from the case of a drag-and-drop operation
being started or ended in another document from another domain.
- <h4 id=the-draggable><span class=secno>5.3.4 </span>The <dfn id=draggable
+ <h4 id=the-draggable><span class=secno>5.3.5 </span>The <dfn id=draggable
title=attr-draggable><code>draggable</code></dfn> attribute</h4>
<p>All elements may have the <code title=attr-draggable><a
@@ -34157,7 +34162,7 @@
href="#draggable">draggable</a></code> content attribute must be set to
the literal value <code title="">true</code>.
- <h4 id=copy-and><span class=secno>5.3.5 </span>Copy and paste</h4>
+ <h4 id=copy-and><span class=secno>5.3.6 </span>Copy and paste</h4>
<p>Copy-and-paste is a form of drag-and-drop: the "copy" part is equivalent
to dragging content to another application (the "clipboard"), and the
@@ -34168,7 +34173,7 @@
System) is equivalent to a drag-and-drop operation where the source is the
selection.
- <h5 id=copy-to><span class=secno>5.3.5.1. </span>Copy to clipboard</h5>
+ <h5 id=copy-to><span class=secno>5.3.6.1. </span>Copy to clipboard</h5>
<p>When the user invokes a copy operation, the user agent must act as if
the user had invoked a drag on the current selection. If the drag-and-drop
@@ -34180,29 +34185,26 @@
agent should then follow the relevant platform-specific conventions for
copy operations (e.g. updating the clipboard).
- <h5 id=cut-to><span class=secno>5.3.5.2. </span>Cut to clipboard</h5>
+ <h5 id=cut-to><span class=secno>5.3.6.2. </span>Cut to clipboard</h5>
<p>When the user invokes a cut operation, the user agent must act as if the
user had invoked a copy operation (see the previous section), followed, if
the copy was completed successfully, by <a
href="#contenteditable-delete">a selection delete operation</a>.
- <h5 id=paste><span class=secno>5.3.5.3. </span>Paste from clipboard</h5>
+ <h5 id=paste><span class=secno>5.3.6.3. </span>Paste from clipboard</h5>
<p>When the user invokes a clipboard paste operation, the user agent must
act as if the user had invoked a drag on a hypothetical application
representing the clipboard, setting the data associated with the drag as
- the text from the keyboard (either as <code title="">text/plain</code> or
- <code>text/uri-list</code>). If the contents of the clipboard cannot be
- represented as text or URIs, then the paste operation must not have any
- effect.
+ the content on the clipboard (in whatever formats are available).
<p>Then, the user agent must act as if the user had indicated (as the <a
href="#immediate">immediate user selection</a>) the element with the
keyboard focus, and then ended the drag-and-drop operation without
canceling it.
- <h5 id=paste0><span class=secno>5.3.5.4. </span>Paste from selection</h5>
+ <h5 id=paste0><span class=secno>5.3.6.4. </span>Paste from selection</h5>
<p>When the user invokes a selection paste operation, the user agent must
act as if the user had invoked a drag on the current selection, then
@@ -34210,10 +34212,7 @@
element with the keyboard focus, and then ended the drag-and-drop
operation without canceling it.
- <p>If the contents of the selection cannot be represented as text or URIs,
- then the paste operation must not have any effect.
-
- <h4 id=security8><span class=secno>5.3.6 </span>Security risks in the
+ <h4 id=security8><span class=secno>5.3.7 </span>Security risks in the
drag-and-drop model</h4>
<p>User agents must not make the data added to the <code><a
Modified: source
===================================================================
--- source 2008-02-14 21:38:35 UTC (rev 1226)
+++ source 2008-02-15 00:56:04 UTC (rev 1227)
@@ -30607,6 +30607,13 @@
step).</p>
+ <h4>Introduction</h4>
+
+ <p><em>This section is non-normative.</em></p>
+
+ <p class="big-issue">It's also currently non-existent.</p>
+
+
<h4>The <code>DragEvent</code> and <code>DataTransfer</code> interfaces</h4>
<p>The drag-and-drop processing model involves several events. They
@@ -30635,15 +30642,10 @@
attribute of the <code>DragEvent</code> interface represents the
context information for the event.</p>
- <p>When a <code>DragEvent</code> object is created, a new
- <code>DataTransfer</code> object must be created and assigned to the
- <code title="dom-DragEvent-dataTransfer">dataTransfer</code>
- context information field of the event object.</p>
-
-
<pre class="idl">interface <dfn>DataTransfer</dfn> {
attribute DOMString <span title="dom-DataTransfer-dropEffect">dropEffect</span>;
attribute DOMString <span title="dom-DataTransfer-effectAllowed">effectAllowed</span>;
+ readonly attribute DOMStringList <span title="dom-DataTransfer-types">types</span>;
void <span title="dom-DataTransfer-clearData">clearData</span>(in DOMString format);
void <span title="dom-DataTransfer-setData">setData</span>(in DOMString format, in DOMString data);
DOMString <span title="dom-DataTransfer-getData">getData</span>(in DOMString format);
@@ -30655,10 +30657,8 @@
<p><code>DataTransfer</code> objects can conceptually contain
various kinds of data.</p>
- <p>When a <code>DragEvent</code> event object is initialised, the
- <code>DataTransfer</code> object created for the event's <code
- title="dom-DragEvent-dataTransfer">dataTransfer</code> member must
- be initialised as follows:</p>
+ <p>When a <code>DataTransfer</code> object is created, it must be
+ initialised as follows:</p>
<ul>
@@ -30740,6 +30740,11 @@
is but it has no URIs, then the method must return the empty
string. <a href="#refsRFC2483">[RFC2483]</a></p>
+ <p>The <dfn title="dom-DataTransfer-types"><code>types</code></dfn>
+ attribute must return a live <code>DOMStringList</code> that
+ contains the list of formats that are stored in the
+ <code>DataTransfer</code> object.</p>
+
<p>The <dfn
title="dom-DataTransfer-setDragImage"><code>setDragImage(<var
title="">element</var>, <var title="">x</var>, <var
@@ -31538,10 +31543,8 @@
<p>When the user invokes a clipboard paste operation, the user agent
must act as if the user had invoked a drag on a hypothetical
application representing the clipboard, setting the data associated
- with the drag as the text from the keyboard (either as <code
- title="">text/plain</code> or <code>text/uri-list</code>). If the
- contents of the clipboard cannot be represented as text or URIs,
- then the paste operation must not have any effect.</p>
+ with the drag as the content on the clipboard (in whatever formats
+ are available).</p>
<p>Then, the user agent must act as if the user had indicated (as
the <span>immediate user selection</span>) the element with the
@@ -31557,11 +31560,8 @@
element with the keyboard focus, and then ended the drag-and-drop
operation without canceling it.</p>
- <p>If the contents of the selection cannot be represented as text or
- URIs, then the paste operation must not have any effect.</p>
-
<h4>Security risks in the drag-and-drop model</h4>
<p>User agents must not make the data added to the
More information about the Commit-Watchers
mailing list