Skip to content

Commit

Permalink
[] (0) define copy-and-paste operations; fix grammar of drag-and-drop…
Browse files Browse the repository at this point in the history
…, fix spelling of canceled

git-svn-id: http://svn.whatwg.org/webapps@535 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 31, 2007
1 parent 50745b4 commit 42db082
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 37 deletions.
112 changes: 92 additions & 20 deletions index
Expand Up @@ -22,7 +22,7 @@

<h1 id=web-applications>Web Applications 1.0</h1>

<h2 class="no-num no-toc" id=working>Working Draft &mdash; 30 January 2007</h2>
<h2 class="no-num no-toc" id=working>Working Draft &mdash; 31 January 2007</h2>

<p>You can take part in this work. <a
href="http://www.whatwg.org/mailing-list">Join the working group's
Expand Down Expand Up @@ -1193,7 +1193,23 @@
id=draggable title=attr-draggable><code>draggable</code></dfn>
attribute</a>

<li><a href="#security1"><span class=secno>6.3.5. </span>Security
<li><a href="#copy-and"><span class=secno>6.3.5. </span>Copy and
paste</a>
<ul class=toc>
<li><a href="#copy-to"><span class=secno>6.3.5.1. </span>Copy to
clipboard</a>

<li><a href="#cut-to"><span class=secno>6.3.5.2. </span>Cut to
clipboard</a>

<li><a href="#paste"><span class=secno>6.3.5.3. </span>Paste from
clipboard</a>

<li><a href="#paste0"><span class=secno>6.3.5.4. </span>Paste from
selection</a>
</ul>

<li><a href="#security1"><span class=secno>6.3.6. </span>Security
risks in the drag-and-drop model</a>
</ul>

Expand Down Expand Up @@ -23606,7 +23622,7 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr

<p>This section defines an event-based drag-and-drop mechanism.

<p>This specification does not define exactly what a <em>drag and drop
<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
Expand All @@ -23619,7 +23635,7 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
explicitly indicate his intention to perform a drag-and-drop operation,
stating what he wishes to drag and what he wishes to drop, respectively.

<p>However it is implemented, drag and drop operations must have a starting
<p>However it is implemented, drag-and-drop operations must have a starting
point (e.g. where the mouse was clicked, or the start of <a
href="#a-selection">the selection</a> or element that was selected for the
drag), may have any number of intermediate steps (elements that the mouse
Expand Down Expand Up @@ -23700,8 +23716,8 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr

<p>The <dfn id=dropeffect
title=dom-DataTransfer-dropEffect><code>dropEffect</code></dfn> attribute
controls the drag and drop feedback that the user is given during a drag
and drop operation.
controls the drag-and-drop feedback that the user is given during a
drag-and-drop operation.

<p>The attribute must ignore any attempts to set it to a value other than
<code title="">none</code>, <code title="">copy</code>, <code
Expand All @@ -23710,7 +23726,7 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr

<p>The <dfn id=effectallowed
title=dom-DataTransfer-effectAllowed><code>effectAllowed</code></dfn>
attribute is used in the drag and drop processing model to initialise the
attribute is used in the drag-and-drop processing model to initialise the
<code title=dom-DataTransfer-dropEffect><a
href="#dropeffect">dropEffect</a></code> attribute during the <code
title=event-dragenter><a href="#dragenter">dragenter</a></code> and <code
Expand Down Expand Up @@ -24093,14 +24109,14 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
title="">text/uri-list</code> format. Otherwise, no data is added to the
object by the user agent.

<p>If the event is canceled, then the drag and drop operation must not
<p>If the event is canceled, then the drag-and-drop operation must not
occur; the user agent must not continue with this algorithm.

<p>If it is not canceled, then the drag and drop operation must be
<p>If it is not canceled, then the drag-and-drop operation must be
initiated.

<p class=note>Since events with no event handlers registered are, almost by
definition, never canceled, drag and drop is always available to the user
definition, never canceled, drag-and-drop is always available to the user
if the author does not specifically prevent it.

<p id=base-dnd-feedback>The drag-and-drop feedback must be generated from
Expand Down Expand Up @@ -24181,7 +24197,7 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
in sequence. (If the user agent is still performing the previous iteration
of the sequence when the next iteration becomes due, the user agent must
not execute the overdue iteration, effectively "skipping missed frames" of
the drag and drop operation.)
the drag-and-drop operation.)

<ol>
<li>
Expand Down Expand Up @@ -24339,8 +24355,8 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
<tr>
<td>"none"

<td>No operation allowed, dropping here will cancel the drag and
drop operation.
<td>No operation allowed, dropping here will cancel the
drag-and-drop operation.
</table>

<li>
Expand All @@ -24352,10 +24368,10 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
</ol>

<li>
<p>Otherwise, if the user ended the drag and drop operation (e.g. by
<p>Otherwise, if the user ended the drag-and-drop operation (e.g. by
releasing the mouse button in a mouse-driven drag-and-drop interface),
or if the <code title=event-drag><a href="#drag">drag</a></code> event
was cancelled, then this will be the last iteration. The user agent must
was canceled, then this will be the last iteration. The user agent must
follow the following steps, then stop looping.</p>

<ol>
Expand Down Expand Up @@ -24442,7 +24458,7 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
with <code title="">type="text"</code><!--XXX xref-->), and a <code
title=event-drop><a href="#drop">drop</a></code> event was fired in
the previous step, and the <a href="#current1">current drag
operation</a> is "move", and the source of the drag and drop
operation</a> is "move", and the source of the drag-and-drop
operation is a selection in the DOM

<dd>The user agent should delete the range representing the dragged
Expand All @@ -24453,7 +24469,7 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
with <code title="">type="text"</code><!--XXX xref-->), and a <code
title=event-drop><a href="#drop">drop</a></code> event was fired in
the previous step, and the <a href="#current1">current drag
operation</a> is "move", and the source of the drag and drop
operation</a> is "move", and the source of the drag-and-drop
operation is a selection in a text field

<dd>The user agent should delete the dragged selection from the
Expand Down Expand Up @@ -24548,7 +24564,63 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
href="#draggable0">draggable</a></code> content attribute must be set to
the literal value <code title="">true</code>.

<h4 id=security1><span class=secno>6.3.5. </span>Security risks in the
<h4 id=copy-and><span class=secno>6.3.5. </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
"paste" part is equivalent to dragging content <em>from</em> another
application.

<p>Select-and-paste (a model used by mouse operations in the X Window
System) is equivalent to a drag-and-drop operation where the source is the
selection.

<h5 id=copy-to><span class=secno>6.3.5.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
operation initiates, then the user agent must act as if the user had
indicated (as the <a href="#immediate">immediate user selection</a>) a
hypothetical application representing the clipbroad. Then, the user agent
must act as if the user had ended the drag-and-drop operation without
canceling it. If the drag-and-drop operation didn't get canceled, the user
agent should then follow the relevant platform-specific conventions for
copy operations (e.g. updating the clipboard).

<h5 id=cut-to><span class=secno>6.3.5.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>6.3.5.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.

<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>6.3.5.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
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.

<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=security1><span class=secno>6.3.6. </span>Security risks in the
drag-and-drop model</h4>

<p>User agents must not make the data added to the <code><a
Expand All @@ -24566,7 +24638,7 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
(canceled) and the <code title=event-drop><a href="#drop">drop</a></code>
event must not be fired.

<p>User agents should take care to not start drag and drop operations in
<p>User agents should take care to not start drag-and-drop operations in
response to script actions. For example, in a mouse-and-window
environment, if a script moves a window while the user has his mouse
button depressed, the UA would not consider that to start a drag. This is
Expand Down Expand Up @@ -34467,7 +34539,7 @@ target element as follows:



mousedown's default action is focus, so cancelling mousedown stops focus transference.
mousedown's default action is focus, so canceling mousedown stops focus transference.
e.g. on http://www.mozilla.org/editor/midasdemo/

xref all the _ERR exceptions to DOM3CORE
Expand Down

0 comments on commit 42db082

Please sign in to comment.