Skip to content

Commit

Permalink
Make the toBlob() callback argument non-nullable
Browse files Browse the repository at this point in the history
As implemented in Gecko, it's not nullable, so this throws:
document.createElement('canvas').toBlob(null)

Passing in null also doesn't make sense, as with no callback you have
no way of getting the Blob, so it must be a programmer error.
  • Loading branch information
foolip authored and domenic committed Dec 3, 2015
1 parent 6f74880 commit 8cee637
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -60645,7 +60645,7 @@ interface <dfn>HTMLCanvasElement</dfn> : <span>HTMLElement</span> {
<span>CanvasProxy</span> <span data-x="dom-canvas-transferControlToProxy">transferControlToProxy</span>();

DOMString <span data-x="dom-canvas-toDataURL">toDataURL</span>(optional DOMString type, any... arguments);
void <span data-x="dom-canvas-toBlob">toBlob</span>(<span>FileCallback</span>? _callback, optional DOMString type, any... arguments);
void <span data-x="dom-canvas-toBlob">toBlob</span>(<span>FileCallback</span> _callback, optional DOMString type, any... arguments);
};</pre>
</dd>
</dl><!--REMOVE-TOPIC:DOM APIs-->
Expand Down Expand Up @@ -61097,8 +61097,6 @@ interface <dfn>HTMLCanvasElement</dfn> : <span>HTMLElement</span> {

<li><p>Return, but continue running these steps <span>in parallel</span>.</p></li>

<li><p>If <var>callback</var> is null, abort these steps.</p></li>

<li><p><span>Queue a task</span> to invoke the <code>FileCallback</code> <var>callback</var> with
<var>result</var> as its argument. The <span>task source</span> for this task is the <dfn>canvas
blob serialisation task source</dfn>.</p></li>
Expand Down

0 comments on commit 8cee637

Please sign in to comment.