Skip to content

Commit

Permalink
[giow] (2) Prevent dead Blobs and Files from being cloned
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=23417
Affected topics: Canvas, DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8310 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 22, 2013
1 parent 0ac0c02 commit 9547701
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
16 changes: 8 additions & 8 deletions complete.html
Expand Up @@ -3820,8 +3820,8 @@ <h4 id=dependencies><span class=secno>2.2.2 </span>Dependencies</h4>
<ul class=brief><li><dfn id=blob><code>Blob</code></dfn></li>
<li><dfn id=file><code>File</code></dfn></li>
<li><dfn id=filelist><code>FileList</code></dfn></li>
<li><dfn id=blob.close()><code title=dom-Blob-close>Blob.close()</code></dfn></li>
<li><dfn id=blob.type><code title=dom-Blob-type>Blob.type</code></dfn></li>
<li><dfn id=dom-blob-close title=dom-Blob-close><code>Blob.close()</code></dfn></li>
<li><dfn id=dom-blob-type title=dom-Blob-type><code>Blob.type</code></dfn></li>
<li>The concept of <dfn id=file-error-read title=file-error-read>read errors</dfn></li>
</ul></dd>

Expand Down Expand Up @@ -8183,9 +8183,8 @@ <h4 id=safe-passing-of-structured-data><span class=secno>2.7.6 </span>Safe passi

<dt>If <var title="">input</var> is a <code><a href=#blob>Blob</a></code> object</dt>

<!--CLEANUP-->
<dd><p>Let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>,
corresponding to the same underlying data.</dd>
<dd><p><p>If <var title="">input</var> has been disabled through the <code title=dom-Blob-close><a href=#dom-blob-close>close()</a></code> method, throw a <code><a href=#datacloneerror>DataCloneError</a></code> exception
and abort the overall <a href=#structured-clone>structured clone</a> algorithm. Otherwise, let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>, corresponding to the same underlying data.</dd>

<dt>If <var title="">input</var> is a <code><a href=#filelist>FileList</a></code> object</dt>

Expand All @@ -8208,6 +8207,7 @@ <h4 id=safe-passing-of-structured-data><span class=secno>2.7.6 </span>Safe passi

<dt>If <var title="">input</var> is an <code><a href=#arraybuffer>ArrayBuffer</a></code> object</dt>

<!--CLEANUP-->
<dd><p>If <var title="">input</var> has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>, throw a <code><a href=#datacloneerror>DataCloneError</a></code>
exception and abort the overall <a href=#structured-clone>structured clone</a> algorithm. Otherwise, let <var title="">output</var> be a newly constructed <code><a href=#arraybuffer>ArrayBuffer</a></code> object whose contents are
a copy of <var title="">input</var>'s contents, with the same length.</dd>
Expand Down Expand Up @@ -74532,7 +74532,7 @@ <h3 id=images><span class=secno>7.7 </span>Images</h3>
<ol><li><p>If either the <var title="">sw</var> or <var title="">sh</var> arguments are specified
but zero, throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception and abort these steps.</li>

<li><p>If the <code><a href=#blob>Blob</a></code> object has been disabled through the <code title=dom-Blob-close>close</code> method, then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
<li><p>If the <code><a href=#blob>Blob</a></code> object has been disabled through the <code title=dom-Blob-close><a href=#dom-blob-close>close()</a></code> method, then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
exception and abort these steps.</li>

<li><p>Return a new <code><a href=#promise>Promise</a></code>, but continue running these steps asynchronously.</li>
Expand All @@ -74543,7 +74543,7 @@ <h3 id=images><span class=secno>7.7 </span>Images</h3>

<li><p>Apply the <a href=#content-type-sniffing:-image title="Content-Type sniffing: image">image sniffing rules</a> to
determine the file format of the image data, with MIME type of the <code><a href=#blob>Blob</a></code> (as given
by the <code><a href=#blob>Blob</a></code> object's <code title=dom-Blob-type>type</code> attribute) giving the
by the <code><a href=#blob>Blob</a></code> object's <code title=dom-Blob-type><a href=#dom-blob-type>type</a></code> attribute) giving the
official type.</li>

<li><p>If the image data is not in a supported file format (e.g. it's not actually an image at
Expand Down Expand Up @@ -76615,7 +76615,7 @@ <h5 id=the-datatransferitemlist-interface><span class=secno>8.7.3.1 </span>The <

<p>Add an item to the <a href=#drag-data-store-item-list>drag data store item list</a> whose <a href=#the-drag-data-item-kind title="the drag data
item kind">kind</a> is <i><a href=#file>File</a></i>, whose <a href=#the-drag-data-item-type-string title="the drag data item type string">type
string</a> is the <code title=dom-Blob-type>type</code> of the <code><a href=#file>File</a></code>,
string</a> is the <code title=dom-Blob-type><a href=#dom-blob-type>type</a></code> of the <code><a href=#file>File</a></code>,
<a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, and whose data is the same as the
<code><a href=#file>File</a></code>'s data.</p>

Expand Down
16 changes: 8 additions & 8 deletions index
Expand Up @@ -3820,8 +3820,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<ul class=brief><li><dfn id=blob><code>Blob</code></dfn></li>
<li><dfn id=file><code>File</code></dfn></li>
<li><dfn id=filelist><code>FileList</code></dfn></li>
<li><dfn id=blob.close()><code title=dom-Blob-close>Blob.close()</code></dfn></li>
<li><dfn id=blob.type><code title=dom-Blob-type>Blob.type</code></dfn></li>
<li><dfn id=dom-blob-close title=dom-Blob-close><code>Blob.close()</code></dfn></li>
<li><dfn id=dom-blob-type title=dom-Blob-type><code>Blob.type</code></dfn></li>
<li>The concept of <dfn id=file-error-read title=file-error-read>read errors</dfn></li>
</ul></dd>

Expand Down Expand Up @@ -8183,9 +8183,8 @@ interface <dfn id=transferable>Transferable</dfn> { };

<dt>If <var title="">input</var> is a <code><a href=#blob>Blob</a></code> object</dt>

<!--CLEANUP-->
<dd><p>Let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>,
corresponding to the same underlying data.</dd>
<dd><p><p>If <var title="">input</var> has been disabled through the <code title=dom-Blob-close><a href=#dom-blob-close>close()</a></code> method, throw a <code><a href=#datacloneerror>DataCloneError</a></code> exception
and abort the overall <a href=#structured-clone>structured clone</a> algorithm. Otherwise, let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>, corresponding to the same underlying data.</dd>

<dt>If <var title="">input</var> is a <code><a href=#filelist>FileList</a></code> object</dt>

Expand All @@ -8208,6 +8207,7 @@ interface <dfn id=transferable>Transferable</dfn> { };

<dt>If <var title="">input</var> is an <code><a href=#arraybuffer>ArrayBuffer</a></code> object</dt>

<!--CLEANUP-->
<dd><p>If <var title="">input</var> has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>, throw a <code><a href=#datacloneerror>DataCloneError</a></code>
exception and abort the overall <a href=#structured-clone>structured clone</a> algorithm. Otherwise, let <var title="">output</var> be a newly constructed <code><a href=#arraybuffer>ArrayBuffer</a></code> object whose contents are
a copy of <var title="">input</var>'s contents, with the same length.</dd>
Expand Down Expand Up @@ -74532,7 +74532,7 @@ interface <dfn id=imagebitmapfactories>ImageBitmapFactories</dfn> {
<ol><li><p>If either the <var title="">sw</var> or <var title="">sh</var> arguments are specified
but zero, throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception and abort these steps.</li>

<li><p>If the <code><a href=#blob>Blob</a></code> object has been disabled through the <code title=dom-Blob-close>close</code> method, then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
<li><p>If the <code><a href=#blob>Blob</a></code> object has been disabled through the <code title=dom-Blob-close><a href=#dom-blob-close>close()</a></code> method, then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
exception and abort these steps.</li>

<li><p>Return a new <code><a href=#promise>Promise</a></code>, but continue running these steps asynchronously.</li>
Expand All @@ -74543,7 +74543,7 @@ interface <dfn id=imagebitmapfactories>ImageBitmapFactories</dfn> {

<li><p>Apply the <a href=#content-type-sniffing:-image title="Content-Type sniffing: image">image sniffing rules</a> to
determine the file format of the image data, with MIME type of the <code><a href=#blob>Blob</a></code> (as given
by the <code><a href=#blob>Blob</a></code> object's <code title=dom-Blob-type>type</code> attribute) giving the
by the <code><a href=#blob>Blob</a></code> object's <code title=dom-Blob-type><a href=#dom-blob-type>type</a></code> attribute) giving the
official type.</li>

<li><p>If the image data is not in a supported file format (e.g. it's not actually an image at
Expand Down Expand Up @@ -76615,7 +76615,7 @@ DND-v5: <span>DataTransferItem</span>? <span title="dom-DataTransferItemList-ad

<p>Add an item to the <a href=#drag-data-store-item-list>drag data store item list</a> whose <a href=#the-drag-data-item-kind title="the drag data
item kind">kind</a> is <i><a href=#file>File</a></i>, whose <a href=#the-drag-data-item-type-string title="the drag data item type string">type
string</a> is the <code title=dom-Blob-type>type</code> of the <code><a href=#file>File</a></code>,
string</a> is the <code title=dom-Blob-type><a href=#dom-blob-type>type</a></code> of the <code><a href=#file>File</a></code>,
<a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, and whose data is the same as the
<code><a href=#file>File</a></code>'s data.</p>

Expand Down
15 changes: 9 additions & 6 deletions source
Expand Up @@ -2596,8 +2596,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn><code>Blob</code></dfn></li>
<li><dfn><code>File</code></dfn></li>
<li><dfn><code>FileList</code></dfn></li>
<li><dfn><code data-x="dom-Blob-close">Blob.close()</code></dfn></li>
<li><dfn><code data-x="dom-Blob-type">Blob.type</code></dfn></li>
<li><dfn data-x="dom-Blob-close"><code>Blob.close()</code></dfn></li>
<li><dfn data-x="dom-Blob-type"><code>Blob.type</code></dfn></li>
<li>The concept of <dfn data-x="file-error-read">read errors</dfn></li>
</ul>

Expand Down Expand Up @@ -7785,9 +7785,11 @@ interface <dfn>Transferable</dfn> { };

<dt>If <var data-x="">input</var> is a <code>Blob</code> object</dt>

<!--CLEANUP-->
<dd><p>Let <var data-x="">output</var> be a newly constructed object of the same class as <var data-x="">input</var>,
corresponding to the same underlying data.</p></dd>
<dd><p><p>If <var data-x="">input</var> has been disabled through the <code
data-x="dom-Blob-close">close()</code> method, throw a <code>DataCloneError</code> exception
and abort the overall <span>structured clone</span> algorithm. Otherwise, let <var
data-x="">output</var> be a newly constructed object of the same class as <var
data-x="">input</var>, corresponding to the same underlying data.</p></dd>

<dt>If <var data-x="">input</var> is a <code>FileList</code> object</dt>

Expand Down Expand Up @@ -7816,6 +7818,7 @@ interface <dfn>Transferable</dfn> { };

<dt>If <var data-x="">input</var> is an <code>ArrayBuffer</code> object</dt>

<!--CLEANUP-->
<dd><p>If <var data-x="">input</var> has been <span
data-x="concept-Transferable-neutered">neutered</span>, throw a <code>DataCloneError</code>
exception and abort the overall <span>structured clone</span> algorithm. Otherwise, let <var
Expand Down Expand Up @@ -83315,7 +83318,7 @@ interface <dfn>ImageBitmapFactories</dfn> {
but zero, throw an <code>IndexSizeError</code> exception and abort these steps.</p></li>

<li><p>If the <code>Blob</code> object has been disabled through the <code
data-x="dom-Blob-close">close</code> method, then throw an <code>InvalidStateError</code>
data-x="dom-Blob-close">close()</code> method, then throw an <code>InvalidStateError</code>
exception and abort these steps.</p></li>

<li><p>Return a new <code>Promise</code>, but continue running these steps asynchronously.</p></li>
Expand Down

0 comments on commit 9547701

Please sign in to comment.