Skip to content

Commit

Permalink
Define ImageBitmapSource in terms of CanvasImageSource
Browse files Browse the repository at this point in the history
Also remove erroneous mentions of CanvasRenderingContext2D as a
CanvasImageSource type. Further cleanup of #790.

See 740634d and
43ad288 for prior commits in this area.

Fixes #893.
  • Loading branch information
annevk committed May 20, 2016
1 parent 018b983 commit c019f66
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -59276,7 +59276,6 @@ callback <dfn>BlobCallback</dfn> = void (<span>Blob</span>? blob);</pre>
typedef (<span>HTMLOrSVGImageElement</span> or
<span>HTMLVideoElement</span> or
<span>HTMLCanvasElement</span> or
<span>CanvasRenderingContext2D</span> or
<span>ImageBitmap</span>) <dfn>CanvasImageSource</dfn>;

enum <dfn>CanvasFillRule</dfn> { "<span data-x="dom-context-2d-fillRule-nonzero">nonzero</span>", "<span data-x="dom-context-2d-fillRule-evenodd">evenodd</span>" };
Expand Down Expand Up @@ -61847,8 +61846,6 @@ try {

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

<li><code>CanvasRenderingContext2D</code></li>

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

</ul>
Expand Down Expand Up @@ -61919,10 +61916,6 @@ try {
<p>When a <code>CanvasImageSource</code> object represents an <code>HTMLCanvasElement</code>, the
element's bitmap must be used as the source image.</p>

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

<p>When a <code>CanvasImageSource</code> object represents an element that is <span>being
rendered</span> and that element has been resized, the original image data of the source image
must be used, not the image as it is rendered (e.g. <code data-x="attr-dim-width">width</code> and
Expand All @@ -61933,15 +61926,11 @@ 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>

<!--ADD-TOPIC:Security-->
<p><dfn>The <var>image argument</var> is not origin-clean</dfn> if it is an
<code>HTMLOrSVGImageElement</code> or <code>HTMLVideoElement</code> whose <span>origin</span> is
not the <span data-x="same origin">same</span> as the <span>origin</span> specified by the
<span>entry settings object</span>, or if it is an <code>HTMLCanvasElement</code> whose bitmap's
<span data-x="concept-canvas-origin-clean">origin-clean</span> flag is false, or if it is a
<code>CanvasRenderingContext2D</code> object whose <span
data-x="concept-canvas-origin-clean">origin-clean</span> flag is false.</p>
<!--REMOVE-TOPIC:Security-->
<span data-x="concept-canvas-origin-clean">origin-clean</span> flag is false.</p>



Expand Down Expand Up @@ -63294,10 +63283,9 @@ v6DVT (also check for '- -' bits in the part above) -->
data-x="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code> attribute is set to
true.</p>

<p class="note">When a <code>canvas</code> or <code>CanvasRenderingContext2D</code> object is
drawn onto itself, the <span>drawing model</span> requires the source to be copied before the
image is drawn, so it is possible to copy parts of a <code>canvas</code> or <span>output
bitmap</span> onto overlapping parts of itself.</p>
<p class="note">When a <code>canvas</code> element is drawn onto itself, the <span>drawing
model</span> requires the source to be copied before the image is drawn, so it is possible to
copy parts of a <code>canvas</code> element onto overlapping parts of itself.</p>

<p>If the original image data is a bitmap image, the value painted at a point in the destination
rectangle is computed by filtering the original image data. The user agent may use any filtering
Expand Down Expand Up @@ -91277,12 +91265,9 @@ interface <dfn>ImageBitmap</dfn> {
void <span data-x="dom-ImageBitmap-close">close</span>();
};

typedef (<span>HTMLOrSVGImageElement</span> or
<span>HTMLVideoElement</span> or
<span>HTMLCanvasElement</span> or
typedef (<span>CanvasImageSource</span> or
<span>Blob</span> or
<span>ImageData</span> or
<span>ImageBitmap</span>) <dfn>ImageBitmapSource</dfn>;
<span>ImageData</span>) <dfn>ImageBitmapSource</dfn>;

enum <dfn>ImageOrientation</dfn> { "<span data-x="dom-ImageOrientation-none">none</span>", "<span data-x="dom-ImageOrientation-flipY">flipY</span>" };
enum <dfn>PremultiplyAlpha</dfn> { "<span data-x="dom-PremultiplyAlpha-none">none</span>", "<span data-x="dom-PremultiplyAlpha-premultiply">premultiply</span>", "<span data-x="dom-PremultiplyAlpha-default">default</span>" };
Expand Down Expand Up @@ -91332,10 +91317,9 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<p>Rejects the promise with an <span>"<code>InvalidStateError</code>"</span>
<code>DOMException</code> if the source image is not in a valid state (e.g. an <code>img</code>
element that hasn't loaded successfully, or a <code>CanvasRenderingContext2D</code> object whose
bitmap data has zero length along one or both dimensions, an <code>ImageBitmap</code> object
whose [[<span>Detached</span>]] internal slot value is true, an <code>ImageData</code> object
whose <code data-x="dom-imagedata-data">data</code> attribute value's [[<span>Detached</span>]]
element that hasn't loaded successfully, an <code>ImageBitmap</code> object whose
[[<span>Detached</span>]] internal slot value is true, an <code>ImageData</code> object whose
<code data-x="dom-imagedata-data">data</code> attribute value's [[<span>Detached</span>]]
internal slot value is true, or a <code>Blob</code> whose data cannot be interpreted as a bitmap
image).</p>

Expand Down

0 comments on commit c019f66

Please sign in to comment.