Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[] (0) Allow createPattern() based on <video> also, for completeness.
git-svn-id: http://svn.whatwg.org/webapps@3049 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 30, 2009
1 parent 5ab111b commit 4081e3c
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 16 deletions.
47 changes: 39 additions & 8 deletions index
Expand Up @@ -22581,6 +22581,7 @@ interface <dfn id=cuerangecallback>CueRangeCallback</dfn> {
<a href=#canvasgradient>CanvasGradient</a> <a href=#dom-context-2d-createradialgradient title=dom-context-2d-createRadialGradient>createRadialGradient</a>(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(in <a href=#htmlimageelement>HTMLImageElement</a> image, in DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(in <a href=#htmlcanvaselement>HTMLCanvasElement</a> image, in DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(in <a href=#htmlvideoelement>HTMLVideoElement</a> image, in DOMString repetition);

// line caps/joins
attribute float <a href=#dom-context-2d-linewidth title=dom-context-2d-lineWidth>lineWidth</a>; // (default 1)
Expand Down Expand Up @@ -23311,7 +23312,8 @@ idea from Mihai:
<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><a href=#the-img-element>img</a></code>,
<code><a href=#the-canvas-element>canvas</a></code>, or <code><a href=#video>video</a></code> element, throws a
<code><a href=#type_mismatch_err>TYPE_MISMATCH_ERR</a></code> exception. If the image is not
fully decoded yet, or has no image data, throws an
<code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception. If the second argument
Expand All @@ -23338,19 +23340,26 @@ idea from Mihai:
folding). The method must return a <code><a href=#canvaspattern>CanvasPattern</a></code> object
suitably initialized.</p>

<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>
<!-- drawImage() has an equivalent paragraph -->
<p>The <var title="">image</var> argument must be an instance of
<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> <!-- drawImage() 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>
<!-- drawImage() 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>
<!-- drawImage() has an equivalent paragraph -->

<p>If the <var title="">image</var> argument is an
<code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code> object with either a horizontal
dimension or a vertical dimension equal to zero, then the
Expand All @@ -23376,6 +23385,11 @@ idea from Mihai:
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><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>
<!-- drawImage() has an equivalent paragraph -->

<!--
Requests for v4 features:
* apply transforms to patterns, so you don't have to create
Expand Down Expand Up @@ -24616,6 +24630,14 @@ v4DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex

<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><a href=#the-img-element>img</a></code>,
<code><a href=#the-canvas-element>canvas</a></code>, or <code><a href=#video>video</a></code> element, throws a
<code><a href=#type_mismatch_err>TYPE_MISMATCH_ERR</a></code> exception. If the image is not
fully decoded yet, or has no image data, throws an
<code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception. If the second argument
isn't one of the allowed values, throws a <code><a href=#syntax_err>SYNTAX_ERR</a></code>
exception.</p>

</dd>

</dl><div class=impl>
Expand All @@ -24626,7 +24648,7 @@ v4DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex
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><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
Expand All @@ -24653,6 +24675,14 @@ v4DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex
<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>
<!-- createPattern() has an equivalent paragraph -->

<p>If the <var title="">image</var> argument is an
<code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code> object with either a horizontal
dimension or a vertical dimension equal to zero, then the
implementation must raise an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></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>
Expand Down Expand Up @@ -24695,6 +24725,7 @@ v4DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex
<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>
<!-- createPattern() has an equivalent paragraph -->

<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
Expand Down
49 changes: 41 additions & 8 deletions source
Expand Up @@ -24631,6 +24631,7 @@ interface <dfn>CueRangeCallback</dfn> {
<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)
Expand Down Expand Up @@ -25511,7 +25512,8 @@ idea from Mihai:
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
Expand Down Expand Up @@ -25543,12 +25545,12 @@ idea from Mihai:
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
Expand All @@ -25557,6 +25559,15 @@ idea from Mihai:
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
Expand All @@ -25583,6 +25594,11 @@ idea from Mihai:
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
Expand Down Expand Up @@ -27047,6 +27063,14 @@ v4DVT (also check for '- -' bits in the part above) -->

<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>
Expand All @@ -27063,7 +27087,7 @@ v4DVT (also check for '- -' bits in the part above) -->
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
Expand Down Expand Up @@ -27093,6 +27117,14 @@ v4DVT (also check for '- -' bits in the part above) -->
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
Expand Down Expand Up @@ -27146,6 +27178,7 @@ v4DVT (also check for '- -' bits in the part above) -->
<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
Expand Down

0 comments on commit 4081e3c

Please sign in to comment.