Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[e] (0) cleanup around the drag-and-drop work
git-svn-id: http://svn.whatwg.org/webapps@5649 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 28, 2010
1 parent ef640d5 commit 7fd2462
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 187 deletions.
102 changes: 38 additions & 64 deletions complete.html
Expand Up @@ -961,12 +961,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
<li><a href=#the-drag-data-store><span class=secno>8.7.2 </span>The drag data store</a></li>
<li><a href=#the-datatransfer-interface><span class=secno>8.7.3 </span>The <code>DataTransfer</code> interface</a></li>
<li><a href=#the-dragevent-interface><span class=secno>8.7.4 </span>The <code>DragEvent</code> interface</a></li>
<li><a href=#drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-drop processing model</a>
<ol>
<li><a href=#when-the-drag-and-drop-operation-starts-or-ends-in-another-document><span class=secno>8.7.5.1 </span>When the drag-and-drop operation starts or ends in another
document</a></li>
<li><a href=#when-the-drag-and-drop-operation-starts-or-ends-in-another-application><span class=secno>8.7.5.2 </span>When the drag-and-drop operation starts or ends in another
application</a></ol></li>
<li><a href=#drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-drop processing model</a></li>
<li><a href=#dndevents><span class=secno>8.7.6 </span>Events summary</a></li>
<li><a href=#the-draggable-attribute><span class=secno>8.7.7 </span>The <code>draggable</code> attribute</a></li>
<li><a href=#security-risks-in-the-drag-and-drop-model><span class=secno>8.7.8 </span>Security risks in the drag-and-drop model</a></ol></li>
Expand Down Expand Up @@ -66575,8 +66570,8 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
</li>

<li><p><a href=#create-a-drag-data-store>Create a drag data store</a>. All the DND events
fired subsequently by this algorithm must use this <a href=#drag-data-store>drag data
store</a>.</li>
fired subsequently by the steps in this section must use this
<a href=#drag-data-store>drag data store</a>.</li>

<li>

Expand All @@ -66595,8 +66590,10 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
<a href=#source-node>source node</a> is the element that is being dragged.</p>

<p>Otherwise, the <a href=#source-node>source node</a> is part of another
document or application, and user agents must not actually fire
events at it when this algorithm requires that they do so.</p>
document or application. When this specification requires that an
event be dispatched at the <a href=#source-node>source node</a> in this case,
the user agent must instead follow the platform-specific
conventions relevant to that situation.</p>

<p class=note>Multiple events are fired on the <a href=#source-node>source
node</a> during the course of the drag-and-drop operation.</p>
Expand Down Expand Up @@ -66649,6 +66646,17 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
outside a <a href=#browsing-context>browsing context</a>, for example from a file
system manager application.</p>

<p>If the drag initiated outside of the application, the user
agent must add items to the <a href=#drag-data-store-item-list>drag data store item list</a>
as appropriate for the data being dragged, honoring platform
conventions where appropriate; however, if the platform
conventions do not use <a href=#mime-type title="MIME type">MIME types</a>
to label dragged data, the user agent must make a best-effort
attempt to map the types to MIME types, and, in any case, all the
<a href=#the-drag-data-item-type-string title="the drag data item type string">drag data item type
strings</a> must be <a href=#converted-to-ascii-lowercase>converted to ASCII
lowercase</a>.</p>

</li>

<!-- v2: text/html as an export format -->
Expand Down Expand Up @@ -66756,13 +66764,15 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
<li>

<p>If it is an element that is being dragged, then set the
<span>drag data store list of elements</span> to contain just the
<a href=#drag-data-store-elements-list>drag data store elements list</a> to contain just the
<a href=#source-node>source node</a>.</p>

<p>Otherwise, update the <a href=#drag-data-store-default-feedback>drag data store default
feedback</a> as appropriate for the user agent (if the user is
dragging the selection, then the selection would likely be the
basis for this feedback).</p>
basis for this feedback; if the drag began outside the user agent,
then the platform conventions for determining the drag feedback
should be used).</p>

<p class=note>Script can use the <code title=dom-DataTransfer-addElement><a href=#dom-datatransfer-addelement>addElement()</a></code> method to
add further elements to the list of what is being dragged. (This
Expand Down Expand Up @@ -66803,8 +66813,8 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
pixels from the left side and from the top side of the image
respectively. <a href=#refsCSS>[CSS]</a></li>

<li>The elements in the <span>drag data store element
list</span>, if any.</li>
<li>The elements in the <a href=#drag-data-store-elements-list>drag data store elements
list</a>, if any.</li>

<li>The <a href=#drag-data-store-default-feedback>drag data store default feedback</a>.</li>

Expand Down Expand Up @@ -66881,11 +66891,16 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
element</a>, then update the <a href=#current-target-element>current target
element</a> as follows:</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>
<dl class=switch><dt>If the new <a href=#immediate-user-selection>immediate user selection</a> is null</dt>

<dd><p>Set the <a href=#current-target-element>current target element</a> to null
also.</dd>

<dd><p>Set the <a href=#current-target-element>current target element</a> to the same
value.</dd>
<dt>If the new <a href=#immediate-user-selection>immediate user selection</a> is in a
non-DOM document or application</dt>

<dd><p>Set the <a href=#current-target-element>current target element</a> to the
<a href=#immediate-user-selection>immediate user selection</a>.</dd>

<dt>Otherwise</dt>

Expand Down Expand Up @@ -67080,7 +67095,7 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
<dt>Otherwise</dt>

<dd><p>Reset the <a href=#current-drag-operation>current drag operation</a> to
"<code title="">none</code>".</p>~</dd>
"<code title="">none</code>".</dd>

</dl></li>

Expand Down Expand Up @@ -67137,52 +67152,11 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
make sense to scroll the page so that the user can drop the link
lower on the page.</p>

</div>


<div class=impl>

<h5 id=when-the-drag-and-drop-operation-starts-or-ends-in-another-document><span class=secno>8.7.5.1 </span>When the drag-and-drop operation starts or ends in another
document</h5>

<p>The model described above is independent of which
<p class=note>This model is independent of which
<code><a href=#document>Document</a></code> object the nodes involved are from; the events
must be fired as described above and the rest of the processing
model must be followed as described above, irrespective of how many
documents are involved in the operation.</p>

</div>



<div class=impl>

<h5 id=when-the-drag-and-drop-operation-starts-or-ends-in-another-application><span class=secno>8.7.5.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 href=#source-node>source
node</a> is not a DOM node, and the user agent must use
platform-specific conventions instead when the requirements above
involve the source node. User agents in this situation must act as
if the dragged data had been added to the <code><a href=#datatransfer>DataTransfer</a></code>
object when the drag started, even though no <code title=event-dragstart><a href=#event-dragstart>dragstart</a></code> event was actually fired;
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>
according to platform-specific conventions.</p>

<p>In any case, scripts running in the context of the document must
not be able to distinguish the case of a drag-and-drop operation
being started or ended in another application from the case of a
drag-and-drop operation being started or ended in another document
from another domain.</p>
are fired as described above and the rest of the processing model
runs as described above, irrespective of how many documents are
involved in the operation.</p>

</div>

Expand Down
102 changes: 38 additions & 64 deletions index
Expand Up @@ -968,12 +968,7 @@
<li><a href=#the-drag-data-store><span class=secno>8.7.2 </span>The drag data store</a></li>
<li><a href=#the-datatransfer-interface><span class=secno>8.7.3 </span>The <code>DataTransfer</code> interface</a></li>
<li><a href=#the-dragevent-interface><span class=secno>8.7.4 </span>The <code>DragEvent</code> interface</a></li>
<li><a href=#drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-drop processing model</a>
<ol>
<li><a href=#when-the-drag-and-drop-operation-starts-or-ends-in-another-document><span class=secno>8.7.5.1 </span>When the drag-and-drop operation starts or ends in another
document</a></li>
<li><a href=#when-the-drag-and-drop-operation-starts-or-ends-in-another-application><span class=secno>8.7.5.2 </span>When the drag-and-drop operation starts or ends in another
application</a></ol></li>
<li><a href=#drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-drop processing model</a></li>
<li><a href=#dndevents><span class=secno>8.7.6 </span>Events summary</a></li>
<li><a href=#the-draggable-attribute><span class=secno>8.7.7 </span>The <code>draggable</code> attribute</a></li>
<li><a href=#security-risks-in-the-drag-and-drop-model><span class=secno>8.7.8 </span>Security risks in the drag-and-drop model</a></ol></li>
Expand Down Expand Up @@ -66581,8 +66576,8 @@ plan:
</li>

<li><p><a href=#create-a-drag-data-store>Create a drag data store</a>. All the DND events
fired subsequently by this algorithm must use this <a href=#drag-data-store>drag data
store</a>.</li>
fired subsequently by the steps in this section must use this
<a href=#drag-data-store>drag data store</a>.</li>

<li>

Expand All @@ -66601,8 +66596,10 @@ plan:
<a href=#source-node>source node</a> is the element that is being dragged.</p>

<p>Otherwise, the <a href=#source-node>source node</a> is part of another
document or application, and user agents must not actually fire
events at it when this algorithm requires that they do so.</p>
document or application. When this specification requires that an
event be dispatched at the <a href=#source-node>source node</a> in this case,
the user agent must instead follow the platform-specific
conventions relevant to that situation.</p>

<p class=note>Multiple events are fired on the <a href=#source-node>source
node</a> during the course of the drag-and-drop operation.</p>
Expand Down Expand Up @@ -66655,6 +66652,17 @@ plan:
outside a <a href=#browsing-context>browsing context</a>, for example from a file
system manager application.</p>

<p>If the drag initiated outside of the application, the user
agent must add items to the <a href=#drag-data-store-item-list>drag data store item list</a>
as appropriate for the data being dragged, honoring platform
conventions where appropriate; however, if the platform
conventions do not use <a href=#mime-type title="MIME type">MIME types</a>
to label dragged data, the user agent must make a best-effort
attempt to map the types to MIME types, and, in any case, all the
<a href=#the-drag-data-item-type-string title="the drag data item type string">drag data item type
strings</a> must be <a href=#converted-to-ascii-lowercase>converted to ASCII
lowercase</a>.</p>

</li>

<!-- v2: text/html as an export format -->
Expand Down Expand Up @@ -66762,13 +66770,15 @@ plan:
<li>

<p>If it is an element that is being dragged, then set the
<span>drag data store list of elements</span> to contain just the
<a href=#drag-data-store-elements-list>drag data store elements list</a> to contain just the
<a href=#source-node>source node</a>.</p>

<p>Otherwise, update the <a href=#drag-data-store-default-feedback>drag data store default
feedback</a> as appropriate for the user agent (if the user is
dragging the selection, then the selection would likely be the
basis for this feedback).</p>
basis for this feedback; if the drag began outside the user agent,
then the platform conventions for determining the drag feedback
should be used).</p>

<p class=note>Script can use the <code title=dom-DataTransfer-addElement><a href=#dom-datatransfer-addelement>addElement()</a></code> method to
add further elements to the list of what is being dragged. (This
Expand Down Expand Up @@ -66809,8 +66819,8 @@ plan:
pixels from the left side and from the top side of the image
respectively. <a href=#refsCSS>[CSS]</a></li>

<li>The elements in the <span>drag data store element
list</span>, if any.</li>
<li>The elements in the <a href=#drag-data-store-elements-list>drag data store elements
list</a>, if any.</li>

<li>The <a href=#drag-data-store-default-feedback>drag data store default feedback</a>.</li>

Expand Down Expand Up @@ -66887,11 +66897,16 @@ plan:
element</a>, then update the <a href=#current-target-element>current target
element</a> as follows:</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>
<dl class=switch><dt>If the new <a href=#immediate-user-selection>immediate user selection</a> is null</dt>

<dd><p>Set the <a href=#current-target-element>current target element</a> to null
also.</dd>

<dd><p>Set the <a href=#current-target-element>current target element</a> to the same
value.</dd>
<dt>If the new <a href=#immediate-user-selection>immediate user selection</a> is in a
non-DOM document or application</dt>

<dd><p>Set the <a href=#current-target-element>current target element</a> to the
<a href=#immediate-user-selection>immediate user selection</a>.</dd>

<dt>Otherwise</dt>

Expand Down Expand Up @@ -67086,7 +67101,7 @@ plan:
<dt>Otherwise</dt>

<dd><p>Reset the <a href=#current-drag-operation>current drag operation</a> to
"<code title="">none</code>".</p>~</dd>
"<code title="">none</code>".</dd>

</dl></li>

Expand Down Expand Up @@ -67143,52 +67158,11 @@ plan:
make sense to scroll the page so that the user can drop the link
lower on the page.</p>

</div>


<div class=impl>

<h5 id=when-the-drag-and-drop-operation-starts-or-ends-in-another-document><span class=secno>8.7.5.1 </span>When the drag-and-drop operation starts or ends in another
document</h5>

<p>The model described above is independent of which
<p class=note>This model is independent of which
<code><a href=#document>Document</a></code> object the nodes involved are from; the events
must be fired as described above and the rest of the processing
model must be followed as described above, irrespective of how many
documents are involved in the operation.</p>

</div>



<div class=impl>

<h5 id=when-the-drag-and-drop-operation-starts-or-ends-in-another-application><span class=secno>8.7.5.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 href=#source-node>source
node</a> is not a DOM node, and the user agent must use
platform-specific conventions instead when the requirements above
involve the source node. User agents in this situation must act as
if the dragged data had been added to the <code><a href=#datatransfer>DataTransfer</a></code>
object when the drag started, even though no <code title=event-dragstart><a href=#event-dragstart>dragstart</a></code> event was actually fired;
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>
according to platform-specific conventions.</p>

<p>In any case, scripts running in the context of the document must
not be able to distinguish the case of a drag-and-drop operation
being started or ended in another application from the case of a
drag-and-drop operation being started or ended in another document
from another domain.</p>
are fired as described above and the rest of the processing model
runs as described above, irrespective of how many documents are
involved in the operation.</p>

</div>

Expand Down

0 comments on commit 7fd2462

Please sign in to comment.