Re: SVG as Widget Icon

On 29.1.2009 23.42, "ext Boris Zbarsky" <bzbarsky@MIT.EDU> wrote:
> Marcos Caceres wrote:
>>> I'm not sure I agree.  I think for security reasons, we should tell
>>> implementors how to treat SVG icons (no script, no interactivity).  They
>>> won't have to strip down the SVG viewer, just set up constraints (which
>>> they need to do anyway).
>> 
>> Ok, I tend to agree with you that this may be what needs to happen.
>> However, I think this was what Boris was saying we should try to
>> avoid. Boris, any thoughts? comments?
> 
> Treating svg icons in widgets in the same mode as <img> pointing to SVG
> sounds great to me.

So in essence you would tell the SVG engine to rasterize the vector image in
whatever size is suitable for the widget engine? (And if there is any
animation, just use the first rendered frame.) If so, the widget engine
needs to pass an icon size in pixels to the SVG engine -- it could be the
'width' and 'height' attributes of the 'icon' element, except that those
values are not necessarily what the widget engine would use. The icon needs
to adapt to the engine and its UI, not the other way around.

Curiously, the spec states in the description of those attributes (section
7.9) [1] that they are "only applicable to graphic formats that have no
intrinsic width or height (e.g., SVG)". But an SVG image may specify a size
with the width and height attributes in the root element [2]. What is
supposed to happen if you have 'width' and 'height' in both?

--Jere

[1] http://www.w3.org/TR/widgets/#the-icon-element
[2] http://www.w3.org/TR/SVGMobile12/struct.html#SVGElement

Received on Friday, 30 January 2009 08:32:10 UTC