[whatwg] SVG extensions to <canvas>

Oliver Hunt oliver at apple.com
Wed May 6 13:16:50 PDT 2009

>> SVG images often don't have an intrinsic size. What's the intrinsic  
>> size of
>> this image?
>> <svg xmlns="http://www.w3.org/2000/svg">
>>   <linearGradient id="g" x1="0" y1="0" x2="1" y2="0">
>>     <stop stop-color="red" offset="0"/><stop stop-color="lime"  
>> offset="1"/>
>>   </linearGradient>
>>   <rect x="0%" y="0%" width="100%" height="100%" fill="url(#g)"/>
>> </svg>
> That <svg> hasn't got intrinsic sizes, so it cannot be rendered on a
> canvas. This doesn't preclude the use of <svg> with intrinsic sizes,
> that are given only by width/height attributes on <svg>.

That's really really bad, as that means sometimes drawing you svg will  
work, and sometimes it won't.  That's why it's a bad API.


More information about the whatwg mailing list