W3C home > Mailing lists > Public > www-svg@w3.org > October 2007

[Fwd: SVG extensions to <canvas>]

From: Doug Schepers <schepers@w3.org>
Date: Thu, 25 Oct 2007 17:05:27 -0400
Message-ID: <47210517.7020603@w3.org>
To: www-svg <www-svg@w3.org>

Forwarded from public-html:

-------- Original Message --------
Subject: SVG extensions to <canvas>
Resent-Date: Thu, 25 Oct 2007 18:58:38 +0000
Resent-From: public-html@w3.org
Date: Thu, 25 Oct 2007 20:58:45 +0200
From: Anne van Kesteren <annevk@opera.com>
Organization: Opera Software ASA
To: HTML WG <public-html@w3.org>, WHATWG <whatwg@whatwg.org>


(Please reply to either HTML or WHATWG list.)

For Opera 9.5 beta we implemented some experimental extensions to <canvas>
involving SVGSvgElement. SVGSvgElement is supported as "image" argument to
both drawImage and createPattern. (An HTMLImageElement pointing to an SVG
element is also supported, but that seems natural if you support SVG from

For drawImage the pixel size of the SVG is determined as follows:

   1. The image size parameters passed to drawImage
   2. The intrinsic size of the SVG image
   3. 300 x 150

For createPattern it is as follows:

   1. The intrinsic size of the SVG image
   2. 300 x 150

(It would be nice if createPattern was extended to allow height/width
arguments as well.)

The intrinsic size of the SVG image is the specified size with percentages
resolved against 300 x 150, and sizes depending on the font-size resolved
against the computed font-size of the SVGSvgElement (will be the browser
default most of the time).

The SVG image is always rendered at time 0 for animated images.

Drawing an SVG image currently marks the canvas context as unsafe so
toDataURL() and getImageData() throw. We expect to make this story a bit
nicer at some point.


Anne van Kesteren
Received on Thursday, 25 October 2007 21:05:56 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:12 UTC