Skip to content

Commit

Permalink
[e] (0) dropzone 1/5: the new model
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10712

git-svn-id: http://svn.whatwg.org/webapps@5646 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 25, 2010
1 parent 74d3e5e commit 1928d48
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 69 deletions.
113 changes: 89 additions & 24 deletions complete.html
Expand Up @@ -214,7 +214,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 23 October 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 25 October 2010</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -65978,35 +65978,90 @@ <h4 id=the-dragevent-and-datatransfer-interfaces><span class=secno>8.7.2 </span>
void <a href=#dom-datatransfer-addelement title=dom-DataTransfer-addElement>addElement</a>(in Element element);
};</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. 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.</p>
<p><code><a href=#datatransfer>DataTransfer</a></code> objects are used to expose the data
that underlies a drag-and-drop operation.</p>

<!--
<p>The data that underlies a drag-and-drop operation, known as the
<dfn id=drag-data-store>drag data store</dfn>, consists of an unordered list of items
representing the dragged data, and some information used to generate
the UI feedback during the drag.</p>

XXX
<p>Each item representing dragged data in a <a href=#drag-data-store>drag data
store</a> has the following information:</p>

here we say what the DataTransfer objects model is, and that it can be in a read/write mode, secret mode, read-only mode
<ul><li>

model is:
- list of items (see DataTransferItem above)
- the drag image (search for "drag feedback"):
- elements
- bitmap, x, y
<p>The type or format of the data, generally given by a <a href=#mime-type>MIME
type</a>. Some values that are not <a href=#mime-type title="MIME type">MIME
types</a> are special-cased for legacy reasons. The API does
not enforce the use of <a href=#mime-type title="MIME type">MIME types</a>;
other values can be used as well. In all cases, however, the
values are all <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a> by the
API.</p>

plan:
1. describe model
2. replace the existing API definitions with links to this model
3. expose model with new API
4. add dropzone="..." feature
</li>

-->
<li>

<p>The kind of data:</p>

<dl><dt>Plain Unicode string</dt>
<dd>
<p>Raw text.</p>
</dd>

<dt>Blob</dt>
<dd>
<p>Binary data.</p>
</dd>

<dt>File</dt>
<dd>
<p>Binary data with a file name.</p>
</dd>

</dl></li>

</ul><p>The information in a <a href=#drag-data-store>drag data store</a> used to
generate the UI feedback during the drag consists of:</p>

<ul><li>A list of zero or more elements.</li>

<li>Optionally, a bitmap image and the coordinate of a point within
that image.</li>

</ul><p>A <a href=#drag-data-store>drag data store</a> is created at the start of a
drag-and-drop operation in the <i>read/write mode</i>, and then
progresses through the following three modes as the operation
proceeds:</p>

<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>
<dl><dt>Read/write mode</dt>
<dd>

<p>At the start of the drag. New data can be added to the
<a href=#drag-data-store>drag data store</a>.</p>

</dd>

<dt>Protected mode</dt>
<dd>

<p>During the drag. The formats and kinds in the <a href=#drag-data-store>drag data
store</a> list of items representing dragged data can be
enumerated, but the data itself is unavailable and no new data can
be added.</p>

</dd>

<dt>Read-only mode</dt>
<dd>

<p>After the drop. The list of items representing dragged data can
be read, including the data. No new data can be added.</p>

</dd>

</dl><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>

Expand Down Expand Up @@ -66093,7 +66148,17 @@ <h4 id=the-dragevent-and-datatransfer-interfaces><span class=secno>8.7.2 </span>

</dd>

</dl><div class=impl>
</dl><!--

XXX

plan:
2. replace the existing API definitions with links to this model
3. make it clear there's a new DataTransfer object with each event
4. expose model with new API
5. add dropzone="..." feature

--><div class=impl>

<p>When a <code><a href=#datatransfer>DataTransfer</a></code> object is created, it must be
initialized as follows:</p>
Expand Down
113 changes: 89 additions & 24 deletions index
Expand Up @@ -218,7 +218,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>HTML5 (including next generation additions still in development)</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 23 October 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 25 October 2010</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -65984,35 +65984,90 @@ interface <dfn id=navigatorabilities>NavigatorAbilities</dfn> {
void <a href=#dom-datatransfer-addelement title=dom-DataTransfer-addElement>addElement</a>(in Element element);
};</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. 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.</p>
<p><code><a href=#datatransfer>DataTransfer</a></code> objects are used to expose the data
that underlies a drag-and-drop operation.</p>

<!--
<p>The data that underlies a drag-and-drop operation, known as the
<dfn id=drag-data-store>drag data store</dfn>, consists of an unordered list of items
representing the dragged data, and some information used to generate
the UI feedback during the drag.</p>

XXX
<p>Each item representing dragged data in a <a href=#drag-data-store>drag data
store</a> has the following information:</p>

here we say what the DataTransfer objects model is, and that it can be in a read/write mode, secret mode, read-only mode
<ul><li>

model is:
- list of items (see DataTransferItem above)
- the drag image (search for "drag feedback"):
- elements
- bitmap, x, y
<p>The type or format of the data, generally given by a <a href=#mime-type>MIME
type</a>. Some values that are not <a href=#mime-type title="MIME type">MIME
types</a> are special-cased for legacy reasons. The API does
not enforce the use of <a href=#mime-type title="MIME type">MIME types</a>;
other values can be used as well. In all cases, however, the
values are all <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a> by the
API.</p>

plan:
1. describe model
2. replace the existing API definitions with links to this model
3. expose model with new API
4. add dropzone="..." feature
</li>

-->
<li>

<p>The kind of data:</p>

<dl><dt>Plain Unicode string</dt>
<dd>
<p>Raw text.</p>
</dd>

<dt>Blob</dt>
<dd>
<p>Binary data.</p>
</dd>

<dt>File</dt>
<dd>
<p>Binary data with a file name.</p>
</dd>

</dl></li>

</ul><p>The information in a <a href=#drag-data-store>drag data store</a> used to
generate the UI feedback during the drag consists of:</p>

<ul><li>A list of zero or more elements.</li>

<li>Optionally, a bitmap image and the coordinate of a point within
that image.</li>

</ul><p>A <a href=#drag-data-store>drag data store</a> is created at the start of a
drag-and-drop operation in the <i>read/write mode</i>, and then
progresses through the following three modes as the operation
proceeds:</p>

<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>
<dl><dt>Read/write mode</dt>
<dd>

<p>At the start of the drag. New data can be added to the
<a href=#drag-data-store>drag data store</a>.</p>

</dd>

<dt>Protected mode</dt>
<dd>

<p>During the drag. The formats and kinds in the <a href=#drag-data-store>drag data
store</a> list of items representing dragged data can be
enumerated, but the data itself is unavailable and no new data can
be added.</p>

</dd>

<dt>Read-only mode</dt>
<dd>

<p>After the drop. The list of items representing dragged data can
be read, including the data. No new data can be added.</p>

</dd>

</dl><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>

Expand Down Expand Up @@ -66099,7 +66154,17 @@ plan:

</dd>

</dl><div class=impl>
</dl><!--

XXX

plan:
2. replace the existing API definitions with links to this model
3. make it clear there's a new DataTransfer object with each event
4. expose model with new API
5. add dropzone="..." feature

--><div class=impl>

<p>When a <code><a href=#datatransfer>DataTransfer</a></code> object is created, it must be
initialized as follows:</p>
Expand Down

0 comments on commit 1928d48

Please sign in to comment.