Re: SVGSVGElement.toDataURL()

Hi Robert,

On 03/11/2013 01:51 PM, Robert Longson wrote:
> Canvas drawImage will take an SVG image as input and you can convert
> that using toDataURL so it's not really missing is it? You just have
> to go through canvas to do it and that's only three lines of code or
> so.
does Canvas drawImage() allow SVGSVGElements to be used? Reading section 
"4.8.11.2 The 2D rendering context" [1] it seems it does not as only 
HTMLImageElement, HTMLVideoElement, HTMLCanvasElement, 
CanvasRenderingContext2D or ImageBitmap are listed as valid 
CanvasImageSource.

I know that FF allows to pass SVG images to Canvas drawImage() but as 
long as this is not explicitly stated by the spec it is not possible to 
use it cross-browser in a safe way.

Klaus

[1] 
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasimagesource
>
> Best regards
>
> Robert.
>

-- 
Klaus Förster
Department of Geography
University of Innsbruck
A-6020 Innsbruck, Innrain 52

Received on Monday, 11 March 2013 13:39:06 UTC