Skip to content

Commit

Permalink
Few minor canvas edits
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@58 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 19, 2006
1 parent dc6a794 commit 3119c96
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 81 deletions.
82 changes: 42 additions & 40 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -12924,7 +12924,7 @@ interface <dfn id="storageitem">StorageItem</dfn> {

<p>Thus, for example, data stored in the global persistent storage for
domain "www.example.com" by a page served from HTTP port 80 will be
available to a page served in <code>http://example.com/:18080</code>, even
available to a page served in <code>http://example.com:18080/</code>, even
if the latter is an experimental server under the control of a different
user.

Expand Down Expand Up @@ -15466,39 +15466,40 @@ http://lxr.mozilla.org/mozilla/source/dom/public/idl/html/nsIDOMNSHTMLTextAreaEl
called with no arguments, return a <code>data:</code> URI containing a
representation of the image as a PNG file. <a href="#refsPNG">[PNG]</a>.

<p>The <dfn id="todataurl0" title="toDataURL-type"><code>toDataURL(<var
title="">type</var>)</code></dfn> method (when called with one <em>or
more</em> arguments) must return a <code>data:</code> URI containing a
representation of the image in the format given by <var
title="">type</var>. The possible values are MIME types with no
parameters, for example <code>image/png</code>, <code>image/jpeg</code>,
or even maybe <code>image/svg+xml</code> if the implementation actually
keeps enough information to reliably render an SVG image from the canvas.

<p>Only support for <code>image/png</code> is required. User agents may
support other types. If the user agent does not support the requested
type, it must return the image using the PNG format.

<p>User agents must convert the provided type to lower case before
establishing if they support that type and before creating the
<code>data:</code> URL.</p>
<!-- XXX define "convert to lower case"
-->

<p class="note">When trying to use types other than <code>image/png</code>,
authors can check if the image was really returned in the requested format
by checking to see if the returned string starts with one the exact
strings "<code>data:image/png,</code>" or "<code>data:image/png;</code>".
If it does, the image is PNG, and thus the requested type was not
supported.

<p>Arguments other than the <var title="">type</var> must be ignored, and
must not cause the user agent to raise an exception (as would normally
occur if a method was called with the wrong number of arguments). A future
version of this specification will probably allow extra parameters to be
passed to <code><a href="#todataurl">toDataURL()</a></code> to allow
authors to more carefully control compression settings, image metadata,
etc.
<div class="proposal">
<p>The <dfn id="todataurl0" title="toDataURL-type"><code>toDataURL(<var
title="">type</var>)</code></dfn> method (when called with one <em>or
more</em> arguments) must return a <code>data:</code> URI containing a
representation of the image in the format given by <var
title="">type</var>. The possible values are MIME types with no
parameters, for example <code>image/png</code>, <code>image/jpeg</code>,
or even maybe <code>image/svg+xml</code> if the implementation actually
keeps enough information to reliably render an SVG image from the canvas.</p>

<p>Only support for <code>image/png</code> is required. User agents may
support other types. If the user agent does not support the requested
type, it must return the image using the PNG format.</p>

<p>User agents must convert the provided type to lower case before
establishing if they support that type and before creating the
<code>data:</code> URL.</p>
<!-- XXX define "convert to lower case"
-->
<p class="note">When trying to use types other than
<code>image/png</code>, authors can check if the image was really
returned in the requested format by checking to see if the returned
string starts with one the exact strings "<code>data:image/png,</code>"
or "<code>data:image/png;</code>". If it does, the image is PNG, and thus
the requested type was not supported.</p>

<p>Arguments other than the <var title="">type</var> must be ignored, and
must not cause the user agent to raise an exception (as would normally
occur if a method was called with the wrong number of arguments). A
future version of this specification will probably allow extra parameters
to be passed to <code><a href="#todataurl">toDataURL()</a></code> to
allow authors to more carefully control compression settings, image
metadata, etc.</p>
</div>

<p><strong>Security:</strong> To prevent <em>information leakage</em>, the
<code><a href="#todataurl">toDataURL()</a></code> and <code><a
Expand Down Expand Up @@ -15888,12 +15889,13 @@ interface <dfn id="imagedata">ImageData</dfn> {
functional-notation format: the literal string <code>rgba</code> (U+0072
U+0067 U+0062 U+0061) followed by a U+0028 LEFT PARENTHESIS, a base-ten
integer in the range 0-255 representing the red component (using digits
0-9, U+0030 to U+0039), a literal U+002C COMMA and U+0020 SPACE, an
integer for the green component, a comma and a space, an integer for the
blue component, another comma and space, a U+0030 DIGIT ZERO, a U+002E
FULL STOP (representing the decimal point), one or more digits in the
range 0-9 (U+0030 to U+0039) representing the fractional part of the alpha
value, and finally a U+0029 RIGHT PARENTHESIS.
0-9, U+0030 to U+0039, in the shortest form possible), a literal U+002C
COMMA and U+0020 SPACE, an integer for the green component, a comma and a
space, an integer for the blue component, another comma and space, a
U+0030 DIGIT ZERO, a U+002E FULL STOP (representing the decimal point),
one or more digits in the range 0-9 (U+0030 to U+0039) representing the
fractional part of the alpha value, and finally a U+0029 RIGHT
PARENTHESIS.

<p>Otherwise, if it is not a color but a <code><a
href="#canvasgradient0">CanvasGradient</a></code> or <code><a
Expand Down
87 changes: 46 additions & 41 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -11100,7 +11100,7 @@ interface <dfn>StorageItem</dfn> {
<p>Thus, for example, data stored in the global persistent storage
for domain "www.example.com" by a page served from HTTP port 80 will
be available to a page served in
<code>http://example.com/:18080</code>, even if the latter is an
<code>http://example.com:18080/</code>, even if the latter is an
experimental server under the control of a different user.</p>

<p>Since the data is not sent over the wire by the user agent, this
Expand Down Expand Up @@ -13541,40 +13541,44 @@ http://lxr.mozilla.org/mozilla/source/dom/public/idl/html/nsIDOMNSHTMLTextAreaEl
representation of the image as a PNG file. <a
href="#refsPNG">[PNG]</a>.</p>

<p>The <dfn
title="toDataURL-type"><code>toDataURL(<var title="">type</var>)</code></dfn>
method (when called with one <em>or more</em> arguments) must return
a <code>data:</code> URI containing a representation of the image in
the format given by <var title="">type</var>. The possible values are MIME
types with no parameters, for example <code>image/png</code>,
<code>image/jpeg</code>, or even maybe <code>image/svg+xml</code> if
the implementation actually keeps enough information to reliably
render an SVG image from the canvas.</p>

<p>Only support for <code>image/png</code> is required. User agents
may support other types. If the user agent does not support the
requested type, it must return the image using the PNG format.</p>

<p>User agents must convert the provided type to lower case before
establishing if they support that type and before creating the
<code>data:</code> URL.</p> <!-- XXX define "convert to lower case"
-->
<div class="proposal">

<p class="note">When trying to use types other than
<code>image/png</code>, authors can check if the image was really
returned in the requested format by checking to see if the returned
string starts with one the exact strings
"<code>data:image/png,</code>" or "<code>data:image/png;</code>". If
it does, the image is PNG, and thus the requested type was not
supported.</p>

<p>Arguments other than the <var title="">type</var> must be
ignored, and must not cause the user agent to raise an exception (as
would normally occur if a method was called with the wrong number of
arguments). A future version of this specification will probably
allow extra parameters to be passed to <code>toDataURL()</code> to
allow authors to more carefully control compression settings, image
metadata, etc.</p>
<p>The <dfn
title="toDataURL-type"><code>toDataURL(<var title="">type</var>)</code></dfn>
method (when called with one <em>or more</em> arguments) must return
a <code>data:</code> URI containing a representation of the image in
the format given by <var title="">type</var>. The possible values are MIME
types with no parameters, for example <code>image/png</code>,
<code>image/jpeg</code>, or even maybe <code>image/svg+xml</code> if
the implementation actually keeps enough information to reliably
render an SVG image from the canvas.</p>

<p>Only support for <code>image/png</code> is required. User agents
may support other types. If the user agent does not support the
requested type, it must return the image using the PNG format.</p>

<p>User agents must convert the provided type to lower case before
establishing if they support that type and before creating the
<code>data:</code> URL.</p> <!-- XXX define "convert to lower case"
-->

<p class="note">When trying to use types other than
<code>image/png</code>, authors can check if the image was really
returned in the requested format by checking to see if the returned
string starts with one the exact strings
"<code>data:image/png,</code>" or "<code>data:image/png;</code>". If
it does, the image is PNG, and thus the requested type was not
supported.</p>

<p>Arguments other than the <var title="">type</var> must be
ignored, and must not cause the user agent to raise an exception (as
would normally occur if a method was called with the wrong number of
arguments). A future version of this specification will probably
allow extra parameters to be passed to <code>toDataURL()</code> to
allow authors to more carefully control compression settings, image
metadata, etc.</p>

</div>

<p><strong>Security:</strong> To prevent <em>information
leakage</em>, the <code>toDataURL()</code> and
Expand Down Expand Up @@ -13949,13 +13953,14 @@ interface <dfn>ImageData</dfn> {
<code>rgba()</code> functional-notation format: the literal string
<code>rgba</code> (U+0072 U+0067 U+0062 U+0061) followed by a U+0028
LEFT PARENTHESIS, a base-ten integer in the range 0-255 representing
the red component (using digits 0-9, U+0030 to U+0039), a literal
U+002C COMMA and U+0020 SPACE, an integer for the green component, a
comma and a space, an integer for the blue component, another comma
and space, a U+0030 DIGIT ZERO, a U+002E FULL STOP (representing the
decimal point), one or more digits in the range 0-9 (U+0030 to
U+0039) representing the fractional part of the alpha value, and
finally a U+0029 RIGHT PARENTHESIS.</p>
the red component (using digits 0-9, U+0030 to U+0039, in the
shortest form possible), a literal U+002C COMMA and U+0020 SPACE, an
integer for the green component, a comma and a space, an integer for
the blue component, another comma and space, a U+0030 DIGIT ZERO, a
U+002E FULL STOP (representing the decimal point), one or more
digits in the range 0-9 (U+0030 to U+0039) representing the
fractional part of the alpha value, and finally a U+0029 RIGHT
PARENTHESIS.</p>

<p>Otherwise, if it is not a color but a <code>CanvasGradient</code>
or <code>CanvasPattern</code>, then an object supporting those
Expand Down

0 comments on commit 3119c96

Please sign in to comment.