Re: SVGSVGElement.toDataURL()

On Mar 11, 2013, at 6:38 AM, Klaus Förster <klaus.foerster@uibk.ac.at> wrote:

> 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.

This is under discussion on the relevant WGs. I think there is an agreement to add it. The discussion is about how. Please take a look at public-canvas mailing list, as well as at WHATWG mailing list. In general, this is nothing that the SVG WG can decide. We can just give guidance.

Greetings,
Dirk

> 
> 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 14:01:37 UTC