HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
3049Allow createPattern() based on <video> also, for completeness.2009-04-30 23:41
@@ -24624,20 +24624,21 @@ interface <dfn>CueRangeCallback</dfn> {
     - the ability to composite an entire set of drawing operations with one shadow all at once
       http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-August/015567.html
 -->
   // colors and styles
            attribute any <span title="dom-context-2d-strokeStyle">strokeStyle</span>; // (default black)
            attribute any <span title="dom-context-2d-fillStyle">fillStyle</span>; // (default black)
   <span>CanvasGradient</span> <span title="dom-context-2d-createLinearGradient">createLinearGradient</span>(in float x0, in float y0, in float x1, in float y1);
   <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)
            attribute DOMString <span title="dom-context-2d-lineCap">lineCap</span>; // "butt", "round", "square" (default "butt")
            attribute DOMString <span title="dom-context-2d-lineJoin">lineJoin</span>; // "round", "bevel", "miter" (default "miter")
            attribute float <span title="dom-context-2d-miterLimit">miterLimit</span>; // (default 10)
 
   // shadows
            attribute float <span title="dom-context-2d-shadowOffsetX">shadowOffsetX</span>; // (default 0)
            attribute float <span title="dom-context-2d-shadowOffsetY">shadowOffsetY</span>; // (default 0)
@@ -25504,21 +25505,22 @@ idea from Mihai:
     title="">repetition</var> argument.</p>
 
     <p>The allowed values for <code title="">repeat</code> are <code
     title="">repeat</code> (both directions), <code
     title="">repeat-x</code> (horizontal only), <code
     title="">repeat-y</code> (vertical only), and <code
     title="">no-repeat</code> (neither). If the <var
     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
     isn't one of the allowed values, throws a <code>SYNTAX_ERR</code>
     exception.</p>
 
    </dd>
 
   </dl>
 
@@ -25536,35 +25538,44 @@ idea from Mihai:
   with one of the following values: <code title="">repeat</code>,
   <code title="">repeat-x</code>, <code title="">repeat-y</code>,
   <code title="">no-repeat</code>. If the empty string or null is
   specified, <code title="">repeat</code> must be assumed. If an
   unrecognized value is given, then the user agent must raise a
   <code>SYNTAX_ERR</code> exception. User agents must recognize the
   four values described above exactly (e.g. they must not do case
   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
   title="dom-img-complete">complete</code> attribute is false, 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>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>
   exception.</p>
   <!-- drawImage() has an equivalent paragraph -->
 
   <p>Patterns must be painted so that the top left of the first image
   is anchored at the origin of the coordinate space, and images are
   then repeated horizontally to the left and right (if the
   <code>repeat-x</code> string was specified) or vertically up and
@@ -25576,20 +25587,25 @@ idea from Mihai:
   stroking or filling effect requires that they be drawn, and are
   affected by the current transformation matrix.</p>
 
   <p>When the <code
   title="dom-context-2d-createPattern">createPattern()</code> method
   is passed, as its <var title="">image</var> argument, an animated
   image, the poster frame of the animation, or the first frame of the
   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
       transformed patterns manually by rendering them to an off-screen
       canvas then using that canvas as the pattern.
   -->
 
   </div>
 
 
@@ -27040,37 +27056,45 @@ v4DVT (also check for '- -' bits in the part above) -->
   <dl class="domintro">
 
    <dt><var title="">context</var> . <code title="">drawImage</code>(<var title="">image</var>, <var title="">dx</var>, <var title="">dy</var>)</dt>
    <dt><var title="">context</var> . <code title="">drawImage</code>(<var title="">image</var>, <var title="">dx</var>, <var title="">dy</var>, <var title="">dw</var>, <var title="">dh</var>)</dt>
    <dt><var title="">context</var> . <code title="">drawImage</code>(<var title="">image</var>, <var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>, <var title="">dx</var>, <var title="">dy</var>, <var title="">dw</var>, <var title="">dh</var>)</dt>
 
    <dd>
 
     <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>
 
   <div class="impl">
 
   <p>If not specified, the <var title="">dw</var> and <var
   title="">dh</var> arguments must default to the values of <var
   title="">sw</var> and <var title="">sh</var>, interpreted such that
   one CSS pixel in the image is treated as one unit in the canvas
   coordinate space. If the <var title="">sx</var>, <var
   title="">sy</var>, <var title="">sw</var>, and <var
   title="">sh</var> arguments are omitted, they must default to 0, 0,
   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
   <code>TYPE_MISMATCH_ERR</code> exception.</p>
   <!-- createPattern() has an equivalent paragraph -->
 
   <p>If the <var title="">image</var> argument is an
   <code>HTMLImageElement</code> object whose <code
   title="dom-img-complete">complete</code> attribute is false, then
   the implementation must raise an <code>INVALID_STATE_ERR</code>
@@ -27086,20 +27110,28 @@ v4DVT (also check for '- -' bits in the part above) -->
   -->
   <!-- createPattern() 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>
+  <!-- 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
   title="">sy</var>), (<span title=""><var title="">sx</var>+<var
   title="">sw</var></span>, <span title=""><var title="">sy</var>+<var
   title="">sh</var></span>), (<var title="">sx</var>, <span title=""><var
   title="">sy</var>+<var title="">sh</var></span>).</p>
 
   <p>If the source rectangle is not entirely within the source image,
@@ -27139,20 +27171,21 @@ v4DVT (also check for '- -' bits in the part above) -->
   title="dom-context-2d-drawImage">drawImage()</code> method is
   passed, as its <var title="">image</var> argument, an
   <code>HTMLImageElement</code> representing an animated image, the
   poster frame of the animation, or the first frame of the animation
   if there is no poster frame, must be used.</p>
   <!-- createPattern() 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>
+  <!-- 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
   title="dom-context-2d-globalAlpha">global alpha</span>, the <span
   title="clipping region">clipping region</span>, and <span
   title="dom-context-2d-globalCompositeOperation">global composition
   operators</span>.</p>
 
   <!-- XXX should somehow say that the image used is the actual image
   of the target element, not the rendered image (e.g. height/width

|