Skip to content

Commit

Permalink
Fix missing references to OffscreenCanvas
Browse files Browse the repository at this point in the history
A few places that do expect a CanvasImageSource omit the OffscreenCanvas interface, while it is defined as being one in https://html.spec.whatwg.org/multipage/canvas.html#canvasimagesource
A couple of non-normative notes also were missing notes about OffscreenCanvas.
  • Loading branch information
Kaiido committed Dec 28, 2023
1 parent b2c8405 commit 23be3ff
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -67192,6 +67192,8 @@ try {

<li><code>HTMLCanvasElement</code> (<code>canvas</code> elements)</li>

<li><code>OffscreenCanvas</code></li>

<li><code>ImageBitmap</code></li>

<li><code>VideoFrame</code></li>
Expand Down Expand Up @@ -67281,6 +67283,9 @@ try {
<p>When a <code>CanvasImageSource</code> object represents an <code>ImageBitmap</code>, the
object's bitmap image data must be used as the source image.</p>

<p>When a <code>CanvasImageSource</code> object represents an <code>OffscreenCanvas</code>, the
object's bitmap must be used as the source image.</p>

<p>When a <code>CanvasImageSource</code> object represents a <code>VideoFrame</code>, the object's
pixel data must be used as the source image, and the source image's dimensions must be the
object's <span>[[display width]]</span> and <span>[[display height]]</span>.</p>
Expand All @@ -67298,6 +67303,7 @@ try {

<dt><code>HTMLCanvasElement</code>
<dt><code>ImageBitmap</code>
<dt><code>OffscreenCanvas</code>
<dd><p><var>image</var>'s bitmap's <span data-x="concept-canvas-origin-clean">origin-clean</span>
flag is false.</p></dd>
</dl>
Expand Down Expand Up @@ -70719,11 +70725,11 @@ interface <dfn interface>OffscreenCanvasRenderingContext2D</dfn> {
access information (e.g. read pixels) from images from another origin (one that isn't the <span
data-x="same origin">same</span>).</p>

<p>To mitigate this, bitmaps used with <code>canvas</code> elements and <code>ImageBitmap</code>
objects are defined to have a flag indicating whether they are <span
data-x="concept-canvas-origin-clean">origin-clean</span>. All bitmaps start with their <span
data-x="concept-canvas-origin-clean">origin-clean</span> set to true. The flag is set to false
when cross-origin images are used.</p>
<p>To mitigate this, bitmaps used with <code>canvas</code> elements, <code>OffscreenCanvas</code>
objects, and <code>ImageBitmap</code> objects are defined to have a flag indicating whether they
are <span data-x="concept-canvas-origin-clean">origin-clean</span>. All bitmaps start with their
<span data-x="concept-canvas-origin-clean">origin-clean</span> set to true. The flag is set to
false when cross-origin images are used.</p>

<p>The <code data-x="dom-canvas-toDataURL">toDataURL()</code>, <code
data-x="dom-canvas-toBlob">toBlob()</code>, and <code
Expand All @@ -70732,9 +70738,9 @@ interface <dfn interface>OffscreenCanvasRenderingContext2D</dfn> {
cross-origin data.</p>

<p>The value of the <span data-x="concept-canvas-origin-clean">origin-clean</span> flag is
propagated from a source <code>canvas</code> element's bitmap to a new <code>ImageBitmap</code>
object by <code data-x="dom-createImageBitmap">createImageBitmap()</code>. Conversely, a
destination <code>canvas</code> element's bitmap will have its <span
propagated from a source's bitmap to a new <code>ImageBitmap</code> object by <code
data-x="dom-createImageBitmap">createImageBitmap()</code>. Conversely, a destination <code
>canvas</code> element's bitmap will have its <span
data-x="concept-canvas-origin-clean">origin-clean</span> flags set to false by <code
data-x="dom-context-2d-drawImage">drawImage</code> if the source image is an
<code>ImageBitmap</code> object whose bitmap has its <span
Expand Down

0 comments on commit 23be3ff

Please sign in to comment.