[whatwg] SVG extensions to <canvas>

Giovanni Campagna scampa.giovanni at gmail.com
Wed May 6 04:53:35 PDT 2009


2009/5/5 Robert O'Callahan <robert at ocallahan.org>:
> On Tue, May 5, 2009 at 4:35 AM, Giovanni Campagna
> <scampa.giovanni at gmail.com> wrote:
>>
>> What is embed used for? Flash and videos. Both have intrinsic sizes
>> What is object used for? Videos, Java applets and Silverlight. They
>> all have intrinsic sizes.
>
> In principal, maybe they do, but typically those sizes are not exposed to
> the browser and are not used in layout.

This is an implementation problem (and likely a bug: if a don't
specify width/height for video I should get the intrinsic size, not a
default)

>> Basically, for what concerns rendering (the element being "replaced"
>> in the CSS meaning of term), <img>,<embed>,<object>,<svg> have
>> intrinsic sizes (they may be rescaled, but this is ortogonal)
>
> 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>.

> Rob
> --
> "He was pierced for our transgressions, he was crushed for our iniquities;
> the punishment that brought us peace was upon him, and by his wounds we are
> healed. We all, like sheep, have gone astray, each of us has turned to his
> own way; and the LORD has laid on him the iniquity of us all." [Isaiah
> 53:5-6]
>

Giovanni



More information about the whatwg mailing list