Short URL: http://html5.org/r/3049
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 3049 | Allow createPattern() based on <video> also, for completeness. | 2009-04-30 23:41 |
Index: source
===================================================================
--- source (revision 3048)
+++ source (revision 3049)
@@ -24631,6 +24631,7 @@
<span>CanvasGradient</span> <span title="dom-context-2d-createRadialGradient">createRadialGradient</span>(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
<span>CanvasPattern</span> <span title="dom-context-2d-createPattern">createPattern</span>(in <span>HTMLImageElement</span> image, in DOMString repetition);
<span>CanvasPattern</span> <span title="dom-context-2d-createPattern">createPattern</span>(in <span>HTMLCanvasElement</span> image, in DOMString repetition);
+ <span>CanvasPattern</span> <span title="dom-context-2d-createPattern">createPattern</span>(in <span>HTMLVideoElement</span> image, in DOMString repetition);
// line caps/joins
attribute float <span title="dom-context-2d-lineWidth">lineWidth</span>; // (default 1)
@@ -25511,7 +25512,8 @@
title="">repetition</var> argument is empty or null, the value
<code title="">repeat</code> is used.</p>
- <p>If the first argument isn't an image, throws a
+ <p>If the first argument isn't an <code>img</code>,
+ <code>canvas</code>, or <code>video</code> element, throws a
<code>TYPE_MISMATCH_ERR</code> exception. If the image is not
fully decoded yet, or has no image data, throws an
<code>INVALID_STATE_ERR</code> exception. If the second argument
@@ -25543,12 +25545,12 @@
folding). The method must return a <code>CanvasPattern</code> object
suitably initialized.</p>
- <p>The <var title="">image</var> argument must be an instance of an
- <code>HTMLImageElement</code> or <code>HTMLCanvasElement</code>. If
- the <var title="">image</var> is of the wrong type or null, the
- implementation must raise a <code>TYPE_MISMATCH_ERR</code>
- exception.</p>
- <!-- drawImage() has an equivalent paragraph -->
+ <p>The <var title="">image</var> argument must be an instance of
+ <code>HTMLImageElement</code>, <code>HTMLCanvasElement</code>, or
+ <code>HTMLVideoElement</code>. If the <var title="">image</var> is
+ of the wrong type or null, the implementation must raise a
+ <code>TYPE_MISMATCH_ERR</code> exception.</p> <!-- drawImage() has
+ an equivalent paragraph -->
<p>If the <var title="">image</var> argument is an
<code>HTMLImageElement</code> object whose <code
@@ -25558,6 +25560,15 @@
<!-- drawImage() has an equivalent paragraph -->
<p>If the <var title="">image</var> argument is an
+ <code>HTMLVideoElement</code> object whose <code
+ title="dom-media-readyState">readyState</code> attribute is either
+ <code title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code> or <code
+ title="dom-media-HAVE_METADATA">HAVE_METADATA</code>, then the
+ implementation must raise an <code>INVALID_STATE_ERR</code>
+ exception.</p>
+ <!-- drawImage() has an equivalent paragraph -->
+
+ <p>If the <var title="">image</var> argument is an
<code>HTMLCanvasElement</code> object with either a horizontal
dimension or a vertical dimension equal to zero, then the
implementation must raise an <code>INVALID_STATE_ERR</code>
@@ -25583,6 +25594,11 @@
animation if there is no poster frame, must be used.</p>
<!-- drawImage() has an equivalent paragraph -->
+ <p>When the <var title="">image</var> argument is an
+ <code>HTMLVideoElement</code>, then the frame at the <span>current
+ playback position</span> must be used as the source image.</p>
+ <!-- drawImage() has an equivalent paragraph -->
+
<!--
Requests for v4 features:
* apply transforms to patterns, so you don't have to create
@@ -27047,6 +27063,14 @@
<p>Draws the given image onto the canvas. The arguments are interpreted as per the diagram below.</p>
+ <p>If the first argument isn't an <code>img</code>,
+ <code>canvas</code>, or <code>video</code> element, throws a
+ <code>TYPE_MISMATCH_ERR</code> exception. If the image is not
+ fully decoded yet, or has no image data, throws an
+ <code>INVALID_STATE_ERR</code> exception. If the second argument
+ isn't one of the allowed values, throws a <code>SYNTAX_ERR</code>
+ exception.</p>
+
</dd>
</dl>
@@ -27063,7 +27087,7 @@
the image's intrinsic width in image pixels, and the image's
intrinsic height in image pixels, respectively.</p>
- <p>The <var title="">image</var> argument must be an instance of an
+ <p>The <var title="">image</var> argument must be an instance of
<code>HTMLImageElement</code>, <code>HTMLCanvasElement</code>, or
<code>HTMLVideoElement</code>. If the <var title="">image</var> is
of the wrong type or null, the implementation must raise a
@@ -27093,7 +27117,15 @@
title="dom-media-HAVE_METADATA">HAVE_METADATA</code>, then the
implementation must raise an <code>INVALID_STATE_ERR</code>
exception.</p>
+ <!-- createPattern() has an equivalent paragraph -->
+ <p>If the <var title="">image</var> argument is an
+ <code>HTMLCanvasElement</code> object with either a horizontal
+ dimension or a vertical dimension equal to zero, then the
+ implementation must raise an <code>INVALID_STATE_ERR</code>
+ exception.</p>
+ <!-- createPattern() has an equivalent paragraph -->
+
<p>The source rectangle is the rectangle whose corners are the four
points (<var title="">sx</var>, <var title="">sy</var>), (<span title=""><var
title="">sx</var>+<var title="">sw</var></span>, <var
@@ -27146,6 +27178,7 @@
<p>When the <var title="">image</var> argument is an
<code>HTMLVideoElement</code>, then the frame at the <span>current
playback position</span> must be used as the source image.</p>
+ <!-- createPattern() has an equivalent paragraph -->
<p>Images are painted without affecting the current path, and are
subject to <span title="shadows">shadow effects</span>, <span