Skip to content
Permalink
Browse files

[giow] (1) Define what should happen with canvas.toBlob() for zero-si…

…zed canvases.

Affected topics: Canvas, DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@6880 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Jan 7, 2012
1 parent c1b1aa2 commit d47dc92a85356cde5df12d35cb84f9de5acacb0e
Showing with 43 additions and 22 deletions.
  1. +14 −7 complete.html
  2. +14 −7 index
  3. +15 −8 source

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 6 January 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 7 January 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
<li><p>Let <var title="">arguments</var> be the second and
subsequent arguments to the method, if any.</li>

<li><p>Let <var title="">file</var> be <a href=#a-serialization-of-the-image-as-a-file>a serialization of the
image as a file</a>, using <var title="">arguments</var>.</li>
<li>

<p>If the canvas has no pixels (i.e. either its horizontal
dimension or its vertical dimension is zero) then let <var title="">result</var> be null.</p>

<p>Otherwise, let <var title="">result</var> be a
<code><a href=#blob>Blob</a></code> object representing <a href=#a-serialization-of-the-image-as-a-file>a serialization of the
image as a file</a>, using <var title="">arguments</var>.</p>

</li>

<li><p>Return, but continue running these steps
asynchronously.</li>
steps.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to invoke the
<code>FileCallback</code> <var title="">callback</var> with a
<code><a href=#blob>Blob</a></code> object representing <var title="">file</var> as
its argument. The <a href=#task-source>task source</a> for this task is the
<dfn id=canvas-blob-serialization-task-source>canvas blob serialization task source</dfn>. <a href=#refsFILESYSTEMAPI>[FILESYSTEMAPI]</a> <a href=#refsFILEAPI>[FILEAPI]</a> </li>
<code>FileCallback</code> <var title="">callback</var> with <var title="">result</var> as its argument. The <a href=#task-source>task source</a>
for this task is the <dfn id=canvas-blob-serialization-task-source>canvas blob serialization task
source</dfn>. <a href=#refsFILESYSTEMAPI>[FILESYSTEMAPI]</a> <a href=#refsFILEAPI>[FILEAPI]</a> </li>

</ol><p>When a user agent is to create <dfn id=a-serialization-of-the-image-as-a-file>a serialization of the image
as a file</dfn>, optionally with some given <var title="">arguments</var>, it must create an image file in the format
21 index

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 6 January 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 7 January 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
<li><p>Let <var title="">arguments</var> be the second and
subsequent arguments to the method, if any.</li>

<li><p>Let <var title="">file</var> be <a href=#a-serialization-of-the-image-as-a-file>a serialization of the
image as a file</a>, using <var title="">arguments</var>.</li>
<li>

<p>If the canvas has no pixels (i.e. either its horizontal
dimension or its vertical dimension is zero) then let <var title="">result</var> be null.</p>

<p>Otherwise, let <var title="">result</var> be a
<code><a href=#blob>Blob</a></code> object representing <a href=#a-serialization-of-the-image-as-a-file>a serialization of the
image as a file</a>, using <var title="">arguments</var>.</p>

</li>

<li><p>Return, but continue running these steps
asynchronously.</li>
steps.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to invoke the
<code>FileCallback</code> <var title="">callback</var> with a
<code><a href=#blob>Blob</a></code> object representing <var title="">file</var> as
its argument. The <a href=#task-source>task source</a> for this task is the
<dfn id=canvas-blob-serialization-task-source>canvas blob serialization task source</dfn>. <a href=#refsFILESYSTEMAPI>[FILESYSTEMAPI]</a> <a href=#refsFILEAPI>[FILEAPI]</a> </li>
<code>FileCallback</code> <var title="">callback</var> with <var title="">result</var> as its argument. The <a href=#task-source>task source</a>
for this task is the <dfn id=canvas-blob-serialization-task-source>canvas blob serialization task
source</dfn>. <a href=#refsFILESYSTEMAPI>[FILESYSTEMAPI]</a> <a href=#refsFILEAPI>[FILEAPI]</a> </li>

</ol><p>When a user agent is to create <dfn id=a-serialization-of-the-image-as-a-file>a serialization of the image
as a file</dfn>, optionally with some given <var title="">arguments</var>, it must create an image file in the format
23 source
<li><p>Let <var title="">arguments</var> be the second and
subsequent arguments to the method, if any.</p></li>

<li><p>Let <var title="">file</var> be <span>a serialization of the
image as a file</span>, using <var
title="">arguments</var>.</p></li>
<li>

<p>If the canvas has no pixels (i.e. either its horizontal
dimension or its vertical dimension is zero) then let <var
title="">result</var> be null.</p>

<p>Otherwise, let <var title="">result</var> be a
<code>Blob</code> object representing <span>a serialization of the
image as a file</span>, using <var title="">arguments</var>.</p>

</li>

<li><p>Return, but continue running these steps
asynchronously.</p></li>
steps.</p></li>

<li><p><span>Queue a task</span> to invoke the
<code>FileCallback</code> <var title="">callback</var> with a
<code>Blob</code> object representing <var title="">file</var> as
its argument. The <span>task source</span> for this task is the
<dfn>canvas blob serialization task source</dfn>. <a
href="#refsFILESYSTEMAPI">[FILESYSTEMAPI]</a> <a
<code>FileCallback</code> <var title="">callback</var> with <var
title="">result</var> as its argument. The <span>task source</span>
for this task is the <dfn>canvas blob serialization task
source</dfn>. <a href="#refsFILESYSTEMAPI">[FILESYSTEMAPI]</a> <a
href="#refsFILEAPI">[FILEAPI]</a> </p></li>

</ol>

0 comments on commit d47dc92

Please sign in to comment.
You can’t perform that action at this time.