@@ -59599,31 +59599,43 @@ callback <dfn>BlobCallback</dfn> = void (<span>Blob</span>? blob);</pre>
59599
59599
<var>quality</var>)</code></dfn> method, when invoked, must run these steps:</p>
59600
59600
59601
59601
<ol>
59602
-
59603
- <!--ADD-TOPIC:Security-->
59604
59602
<li><p>If this <code>canvas</code> element's bitmap's <span
59605
59603
data-x="concept-canvas-origin-clean">origin-clean</span> flag is set to false, then throw a
59606
- <span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p>
59607
- <!--REMOVE-TOPIC:Security-->
59604
+ <span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p></li>
59605
+
59606
+ <li><p>Let <var>result</var> be null.</p></li>
59607
+
59608
+ <li><p>If this <code>canvas</code> element's bitmap has pixels (i.e., neither its horizontal
59609
+ dimension nor its vertical dimension is zero), then set <var>result</var> to a copy of this
59610
+ <code>canvas</code> element's bitmap.
59608
59611
59609
59612
<li>
59610
- <p>If this <code>canvas</code> element's bitmap has no pixels (i.e. either its horizontal
59611
- dimension or its vertical dimension is zero) then let <var>result</var> be null.</p>
59613
+ <p>Run these steps <span>in parallel</span>:</p>
59612
59614
59613
- <p>Otherwise, let <var>result</var> be a <code>Blob</code> object representing <span data-x="a
59614
- serialization of the bitmap as a file">a serialization of this <code>canvas</code> element's
59615
- bitmap as a file</span>, passing <var>type</var> and <var>quality</var> if they were given. <ref
59616
- spec=FILEAPI></p>
59617
- </li>
59615
+ <ol>
59616
+ <li><p>If <var>result</var> is non-null, then set <var>result</var> to <span data-x="a
59617
+ serialization of the bitmap as a file">a serialization of <var>result</var> as a file</span>,
59618
+ with <var>type</var> and <var>quality</var> if they were given.</p></li>
59618
59619
59619
- <li><p>Return, but continue running these steps <span>in parallel</span>.</p></li>
59620
+ <li>
59621
+ <p><span>Queue a task</span> to run these steps:</p>
59620
59622
59621
- <li><p><span>Queue a task</span> to <span data-x="es-invoking-callback-functions">invoke</span >
59622
- the <code>BlobCallback</code> <var>callback </var> with <var>result</var> as its argument. The
59623
- <span>task source</span> for this task is the
59624
- <!--en-GB--><dfn id="canvas-blob-serialisation-task-source" >canvas blob serialization task
59625
- source</dfn>. </p></li>
59623
+ <ol >
59624
+ <li><p>If <var>result </var> is non-null, then set <var>result</var> to a new
59625
+ <code>Blob</code> object, created in the <span data-x="concept-relevant-realm">relevant
59626
+ Realm</span> of this <code >canvas</code> element, representing <var>result</var>. <ref
59627
+ spec=FILEAPI> </p></li>
59626
59628
59629
+ <li><p><span data-x="es-invoking-callback-functions">Invoke</span> <var>callback</var> with
59630
+ « <var>result</var> ».</p></li>
59631
+ </ol>
59632
+
59633
+ <p>The <span>task source</span> for this task is the
59634
+ <!--en-GB--><dfn id="canvas-blob-serialisation-task-source">canvas blob serialization task
59635
+ source</dfn>.</p>
59636
+ </li>
59637
+ </ol>
59638
+ </li>
59627
59639
</ol>
59628
59640
59629
59641
<p>The <dfn><code
@@ -65286,28 +65298,44 @@ interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> {
65286
65298
promise rejected with a <span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p>
65287
65299
65288
65300
<li><p>If this <code>OffscreenCanvas</code> object's <span
65289
- data-x="offscreencanvas-bitmap">bitmap</span> has no pixels (i.e. either its
65301
+ data-x="offscreencanvas-bitmap">bitmap</span> has no pixels (i.e., either its
65290
65302
horizontal dimension or its vertical dimension is zero) then return a promise rejected with an
65291
65303
<span>"<code>IndexSizeError</code>"</span> <code>DOMException</code>.</p></li>
65292
65304
65305
+ <li><p>Let <var>bitmap</var> be a copy of this <code>OffscreenCanvas</code> object's <span
65306
+ data-x="offscreencanvas-bitmap">bitmap</span>.</p></li>
65307
+
65293
65308
<li><p>Let <var>result</var> be a new promise object.</p></li>
65294
65309
65295
- <li><p>Return <var>result</var>, and <span>queue a task</span> to run the remaining steps
65296
- <span>in parallel</span>.</p></li>
65310
+ <li>
65311
+ <p>Run these steps <span>in parallel</span>:</p>
65312
+
65313
+ <ol>
65314
+ <li><p>Let <var>file</var> be <span data-x="a serialization of the bitmap as a file">a
65315
+ serialization of <var>bitmap</var> as a file</span>, with <var>options</var>'s <dfn><code
65316
+ data-x="image-encode-options-type">type</code></dfn> and <dfn><code
65317
+ data-x="image-encode-options-quality">quality</code></dfn>.</p></li>
65318
+
65319
+ <li>
65320
+ <p><span>Queue a task</span> to run these steps:</p>
65297
65321
65298
- <li><p>Let <var>blob</var> be a <code>Blob</code> object, created in the <span
65299
- data-x="concept-relevant-realm">relevant Realm</span> of this <code>OffscreenCanvas</code>
65300
- object, representing <span data-x="a serialization of the bitmap as a file">a serialization of
65301
- this <code>OffscreenCanvas</code> object's <span data-x="offscreencanvas-bitmap">bitmap</span> as
65302
- a file</span>, passing the values of the <dfn><code
65303
- data-x="image-encode-options-type">type</code></dfn> and <dfn><code
65304
- data-x="image-encode-options-quality">quality</code></dfn> fields of <var>options</var>, if
65305
- <var>options</var> was specified. <ref spec=FILEAPI></p></li>
65322
+ <ol>
65323
+ <li><p>If <var>file</var> is null, then reject <var>result</var> with an
65324
+ <span>"<code>EncodingError</code>"</span> <code>DOMException</code>.</p></li>
65306
65325
65307
- <li><p>If <var>blob</var> is null, then reject <var>result</var> with an
65308
- <span>"<code>EncodingError</code>"</span> <code>DOMException</code>.</p></li>
65326
+ <li><p>Otherwise, resolve <var>result</var> with a new <code>Blob</code> object, created in
65327
+ the <span data-x="concept-relevant-realm">relevant Realm</span> of this
65328
+ <code>OffscreenCanvas</code> object, representing <var>file</var>. <ref
65329
+ spec=FILEAPI></p></li>
65330
+ </ol>
65309
65331
65310
- <li><p>Otherwise, resolve <var>result</var> with <var>blob</var>.</p></li>
65332
+ <p>The <span>task source</span> for this task is the <span>canvas blob serialization task
65333
+ source</span>.</p>
65334
+ </li>
65335
+ </ol>
65336
+ </li>
65337
+
65338
+ <li><p>Return <var>result</var>.</p></li>
65311
65339
</ol>
65312
65340
65313
65341
<p>The <dfn><code
0 commit comments