Re: SVGSVGElement.toDataURL()

On Mar 11, 2013, at 6:31 AM, Jeremie Patonnier <jeremie.patonnier@gmail.com> wrote:

> Hi Robert,
> 
> 
> 2013/3/11 Robert Longson <longsonr@gmail.com>
> Canvas drawImage will take an SVG image as input and you can convert
> that using toDataURL
>  
> I didn't test this yet, but it should turn the SVG image into a rastered image, shouldn't it?
> If it's so, it would be useful to have a SVGSVGElement.toDataURL() to get an SVG image rather than a raster PNG.
> 
> Actually it would be useful to have something like innerHTML on SVGElement. This would allow to get a string representation of any SVG DOM tree. Once we have such a string representation, it's trivial to produce a DATA URI.

Indeed, this would be nice and was discussed before. I would rather not create a 'innerSVG' function but reuse 'innerHTML'. It might be the wrong naming schema, but authors would expect it to work. 'innerhHTML' is defined in 'HTMLElement.idl' at the moment. This definition would need to move to 'Element.idl'. The HTML WG and WEBAPS WG need to agree on that.

Greetings,
Dirk

> 
> Best,
> -- 
> Jeremie
> .............................
> Web : http://jeremie.patonnier.net
> Twitter : @JeremiePat

Received on Monday, 11 March 2013 14:04:07 UTC