W3C home > Mailing lists > Public > public-html-diffs@w3.org > February 2009

spec/Overview.html 1.2016 2845 Define that <canvas>'s drawImage() can t

From: poot <cvsmail@w3.org>
Date: Fri, 20 Feb 2009 10:23:49 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20090220012349.523B42BC23@toro.w3.mag.keio.ac.jp>
Define that <canvas>'s drawImage() can take a <video>. (whatwg r2845)

poster frame
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#poster-frame
Status of this document
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#status-of-this-document
poster
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#dom-video-poster
CanvasRenderingContext2D
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#canvasrenderingcontext2d
A vocabulary and associated APIs for HTML and XHTML
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#a-vocabulary-and-associated-apis-for-html-and-xhtml
width
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#dom-textmetrics-width
W3C Working Draft 12 February 2009
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#w3c-working-draft-12-february-year
4.8.11.1.10 Images
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2016.html#images

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.2015&r2=1.2016&f=h
http://html5.org/tools/web-apps-tracker?from=2844&to=2845

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.2015
retrieving revision 1.2016
diff -u -d -r1.2015 -r1.2016
--- Overview.html	19 Feb 2009 11:30:30 -0000	1.2015
+++ Overview.html	20 Feb 2009 01:10:25 -0000	1.2016
@@ -10,7 +10,7 @@
    <p><a href=http://www.w3.org/><img alt=W3C height=48 src=http://www.w3.org/Icons/w3c_home width=72></a></p>
    <h1>HTML 5</h1>
    <h2 class="no-num no-toc" id=a-vocabulary-and-associated-apis-for-html-and-xhtml>A vocabulary and associated APIs for HTML and XHTML</h2>
-   <h2 class="no-num no-toc" id=w3c-working-draft-12-february-year><!--ZZZ:--> W3C Working Draft 12 February 2009<!-- fix date ZZZ --><!-- Editor's Draft 19 February 2009 --><!--:ZZZ--></h2>
+   <h2 class="no-num no-toc" id=w3c-working-draft-12-february-year><!--ZZZ:--> W3C Working Draft 12 February 2009<!-- fix date ZZZ --><!-- Editor's Draft 20 February 2009 --><!--:ZZZ--></h2>
    <dl><!-- ZZZ: update the month/day (twice), uncomment out --><dt>This Version:</dt>
     <dd><a href=http://www.w3.org/TR/2009/WD-html5-20090212/>http://www.w3.org/TR/2009/WD-html5-20090212/</a></dd>
 <!-- :ZZZ -->
@@ -100,7 +100,7 @@
   track.
   <!--ZZZ:-->
   This specification is the 12 February 2009 Working Draft.
-  <!-- This specification is the 19 February 2009 Editor's Draft. -->
+  <!-- This specification is the 20 February 2009 Editor's Draft. -->
   <!--:ZZZ-->
   </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is also being produced by the <a href=http://www.whatwg.org/>WHATWG</a>. The two specifications are
   identical from the table of contents onwards.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) --><p>This specification is intended to replace (be a new version of)
@@ -14563,9 +14563,10 @@
   (typically one of the first non-blank frames) that gives the user an
   idea of what the video is like.<p>The <dfn id=dom-video-poster title=dom-video-poster><code>poster</code></dfn> DOM
   attribute must <a href=#reflect>reflect</a> the <code title=attr-video-poster><a href=#attr-video-poster>poster</a></code> content attribute.</p><hr><p>When no video data is available (the element's <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute is either
-  <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code> or <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>), the
-  <code><a href=#video>video</a></code> element <a href=#represents>represents</a> either the
-  <a href=#poster-frame>poster frame</a>, or nothing.<p>When a <code><a href=#video>video</a></code> element is <a href=#dom-media-paused title=dom-media-paused>paused</a> and the <a href=#current-playback-position title="current
+  <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, or <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> but no video
+  data has yet been obtained at all), the <code><a href=#video>video</a></code> element
+  <a href=#represents>represents</a> either the <a href=#poster-frame>poster frame</a>, or
+  nothing.<p>When a <code><a href=#video>video</a></code> element is <a href=#dom-media-paused title=dom-media-paused>paused</a> and the <a href=#current-playback-position title="current
   playback position">current playback position</a> is the first
   frame of video, the element <a href=#represents>represents</a> either the frame
   of video corresponding to the <a href=#current-playback-position title="current playback
@@ -16582,11 +16583,13 @@
   void <span title="dom-context-2d-strokeVerticalText">strokeVerticalText</span>(in DOMString text, in float x, in float y, [Optional] in float maxHeight); -->
   <a href=#textmetrics>TextMetrics</a> <a href=#dom-context-2d-measuretext title=dom-context-2d-measureText>measureText</a>(in DOMString text);
 
-  // drawing images<!-- XXX add and define HTMLVideoElement variants -->
+  // drawing images
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(in <a href=#htmlimageelement>HTMLImageElement</a> image, in float dx, in float dy, [Optional] in float dw, in float dh);
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(in <a href=#htmlimageelement>HTMLImageElement</a> image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(in <a href=#htmlcanvaselement>HTMLCanvasElement</a> image, in float dx, in float dy, [Optional] in float dw, in float dh);
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(in <a href=#htmlcanvaselement>HTMLCanvasElement</a> image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
+  void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(in <a href=#htmlvideoelement>HTMLVideoElement</a> image, in float dx, in float dy, [Optional] in float dw, in float dh);
+  void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(in <a href=#htmlvideoelement>HTMLVideoElement</a> image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
 
   // pixel manipulation
   <a href=#imagedata>ImageData</a> <a href=#dom-context-2d-createimagedata title=dom-context-2d-createImageData>createImageData</a>(in float sw, in float sh);
@@ -17655,31 +17658,34 @@
   way to render fragments of documents, rendered using CSS, straight
   to the canvas. This would be provided in preference to a dedicated
   way of doing multiline layout.<h6 id=images><span class=secno>4.8.11.1.10 </span>Images</h6><p>To draw images onto the canvas, the <dfn id=dom-context-2d-drawimage title=dom-context-2d-drawImage><code>drawImage</code></dfn> method
-  can be used.<p>This method is overloaded with three variants: <code title="">drawImage(<var title="">image</var>, <var title="">dx</var>, <var title="">dy</var>)</code>, <code title="">drawImage(<var title="">image</var>, <var title="">dx</var>, <var title="">dy</var>, <var title="">dw</var>,
-  <var title="">dh</var>)</code>, and <code title="">drawImage(<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>)</code>. (Actually it is
-  overloaded with six; each of those three can take either an
-  <code><a href=#htmlimageelement>HTMLImageElement</a></code> or an <code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code>
-  for the <var title="">image</var> argument.)  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>The <var title="">image</var> argument must be an instance of an
-  <code><a href=#htmlimageelement>HTMLImageElement</a></code> or <code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code>. If
-  the <var title="">image</var> is of the wrong type or null, the
-  implementation must raise a <code><a href=#type_mismatch_err>TYPE_MISMATCH_ERR</a></code>
-  exception.</p><!-- createPattern() has an equivalent paragraph --><p>If the <var title="">image</var> argument is an
+  can be used.<p>This method can be invoked with three different sets of argments:<ul class=brief><li><code title="">drawImage(<var title="">image</var>, <var title="">dx</var>, <var title="">dy</var>)</code>
+   <li><code title="">drawImage(<var title="">image</var>, <var title="">dx</var>, <var title="">dy</var>, <var title="">dw</var>, <var title="">dh</var>)</code>
+   <li><code title="">drawImage(<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>)</code>
+  </ul><p>Each of those three can take either an
+  <code><a href=#htmlimageelement>HTMLImageElement</a></code>, an <code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code>, or
+  an <code><a href=#htmlvideoelement>HTMLVideoElement</a></code> for the <var title="">image</var>
+  argument.<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>The <var title="">image</var> argument must be an instance of an
+  <code><a href=#htmlimageelement>HTMLImageElement</a></code>, <code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code>, or
+  <code><a href=#htmlvideoelement>HTMLVideoElement</a></code>. If the <var title="">image</var> is
+  of the wrong type or null, the implementation must raise a
+  <code><a href=#type_mismatch_err>TYPE_MISMATCH_ERR</a></code> exception.</p><!-- createPattern() has an equivalent paragraph --><p>If the <var title="">image</var> argument is an
   <code><a href=#htmlimageelement>HTMLImageElement</a></code> object whose <code title=dom-img-complete><a href=#dom-img-complete>complete</a></code> attribute is false, then
   the implementation must raise an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code>
-  exception.</p><!-- createPattern() has an equivalent paragraph --><!-- handled by the next paragraph
+  exception.</p><!-- createPattern() has an equivalent paragraph --><!-- handled by a later 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>
+  implementation must raise an <code>INVALID_SIZE_ERR</code>
   exception.</p>
-  --><!-- createPattern() has an equivalent paragraph --><p>The source rectangle is the rectangle whose corners are the four
+  --><!-- createPattern() has an equivalent paragraph --><p>If the <var title="">image</var> argument is an
+  <code><a href=#htmlvideoelement>HTMLVideoElement</a></code> object whose <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute is either
+  <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code> or <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>, then the
+  implementation must raise an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code>
+  exception.<p>The source rectangle is the rectangle whose corners are the four
   points (<var title="">sx</var>, <var title="">sy</var>), (<span><var title="">sx</var>+<var title="">sw</var></span>, <var title="">sy</var>), (<span><var title="">sx</var>+<var title="">sw</var></span>, <span><var title="">sy</var>+<var title="">sh</var></span>), (<var title="">sx</var>, <span><var title="">sy</var>+<var title="">sh</var></span>).<p>If the source rectangle is not entirely within the source image,
   or if one of the <var title="">sw</var> or <var title="">sh</var>
   arguments is zero, the implementation must raise an
@@ -17695,9 +17701,12 @@
   model requires the source to be copied before the image is drawn
   back onto the canvas, so it is possible to copy parts of a canvas
   onto overlapping parts of itself.<p>When the <code title=dom-context-2d-drawImage><a href=#dom-context-2d-drawimage>drawImage()</a></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><!-- createPattern() has an equivalent paragraph --><p>Images are painted without affecting the current path, and are
+  passed, as its <var title="">image</var> argument, an
+  <code><a href=#htmlimageelement>HTMLImageElement</a></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><a href=#htmlvideoelement>HTMLVideoElement</a></code>, then the frame at the <a href=#current-playback-position>current
+  playback position</a> must be used as the source image.<p>Images are painted without affecting the current path, and are
   subject to <a href=#shadows title=shadows>shadow effects</a>, <a href=#dom-context-2d-globalalpha title=dom-context-2d-globalAlpha>global alpha</a>, the <a href=#clipping-region title="clipping region">clipping region</a>, and <a href=#dom-context-2d-globalcompositeoperation title=dom-context-2d-globalCompositeOperation>global composition
   operators</a>.</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
Received on Friday, 20 February 2009 01:24:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 06:13:58 GMT