Re: SVG as Widget Icon
On 29.1.2009 23.42, ext Boris Zbarsky bzbar...@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
Re: SVG as Widget Icon
Hi, Marcos- Marcos Caceres wrote (on 1/29/09 12:51 PM): On Thu, Jan 29, 2009 at 5:28 PM, Doug Schepers schep...@w3.org wrote: If you would like me to work up proposed spec text, I could oblige you. That would be great! The relevant sections are: http://dev.w3.org/2006/waf/widgets/#dependencies-on-other-specifications-and-file-formats http://dev.w3.org/2006/waf/widgets/#custom-icons-and-default-icons I've attached some proposed wording for the sections you mentioned. I hope this helps. Regards- -Doug Schepers W3C Team Contact, SVG and WebApps WGs = http://dev.w3.org/2006/waf/widgets/#dependencies-on-other-specifications-and-file-formats == (Insert after File Formats list) pA widget user agent em class=ctmay/em support Scalable Vector Graphics conforming to any version of the specification, including a href=#svg[SVG]/a, a href=#svgtiny[SVGTiny]/a, or a href=#svgtiny12[SVGTiny12]/a, for use as an icon or as content./p (Insert in references section) dtdfn id=svg[SVG]/dfn/dt ddScalable Vector Graphics (SVG) 1.1 Specification. Jon Ferraiolo, è¤æ²¢ æ·³, Dean Jackson. W3C Recommendation 14 January 2003/dd dtdfn id=svgtiny[SVGTiny]/dfn/dt ddcitea href=http://www.w3.org/TR/2003/REC-SVGMobile-20030114/;Mobile SVG Profiles: SVG Tiny and SVG Basic/a/cite. W3C Recommendation, 14 January 2003./dd dtdfn id=svgtiny12[SVGTiny12]/dfn/dt ddcitea href=http://www.w3.org/TR/2008/REC-SVGTiny12-20081222/;Scalable Vector Graphics (SVG) Tiny 1.2 Specification/a/cite. O. Andersson, R. Berjon, E. Dahlström, A. Emmons, J. Ferraiolo, A. Grasso, V. Hardy, S. Hayman, D. Jackson, C. Lilley, C. McCormack, A. Neumann, C. Northway, A. Quint, N. Ramani, D. Schepers, A. Shellshear. W3C Recommendation, 22 December 2008./dd = http://dev.w3.org/2006/waf/widgets/#custom-icons-and-default-icons == (Insert after Default Icons table) pNote that implementations which allow the use of em class=cta href=#svg[SVG]/a/em as an icon format em class=ctmay/em display declarative animation, but em class=ctmust not/em execute scripts or interactivity defined within the icon file, for security purposes. This is defined as the set of features intended for use of SVG as a dynamic image, corresponding to the a href=#svgtiny[SVGTiny]/a profile, and to specific feature strings for a href=#svg[SVG]/a (http://www.w3.org/TR/SVG11/feature#SVG-static;) and a href=#svgtiny12[SVGTiny12]/a (http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-animated;)./p pstrongAuthor requirement: /strongauthors using em class=cta href=#svg[SVG]/a/em as an icon format em class=ctmay/em create icons that use declarative animation, but em class=ctmust not/em rely upon script or interactivity within the icon file./p h4 class=no-toc no-num id=conformance-checker-behavior-4Conformance checker behavior/h4 pIf a CC encounters an icon in the a href=#svg[SVG]/a format, it em class=ctmay/em warn the author if the icon includes script or interactive functionality./p
Re: SVG as Widget Icon
Jere Kapyaho wrote: 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? Not necessarily, no. Of course the rasterization happens at some point, since the display medium typically works with discrete pixels, but it could well be happening at the hardware layer. (And if there is any animation, just use the first rendered frame.) Declarative animation would be allowed. If so, the widget engine needs to pass an icon size in pixels to the SVG engine It needs to do so anyway, no? No idea on your question about conflicts of width/height; I'm not that familiar with the relevant part of the widgets spec. -Boris
Re: SVG as Widget Icon (was: Request for Comments: Last Call WD of Widgets 1.0: Packaging Configuration spec; deadline 31 Jan 2009)
On Wed, 28 Jan 2009 19:59:53 +0100, Doug Schepers schep...@w3.org wrote: On another topic, I would like to use Widgets with pure SVG content, rather than including HTML... I didn't see a clear way to do this, nor was it explicitly disallowed. I'll review the spec more to see if there are problems in this regard. Informational: Opera's pre-PC-implementation allows widgets in any format that Opera can handle natively, using the widgetfile element [1][2]. Given that the PC-specification does not explicitly disallow or mandate a content type for the start file, I would expect this behavior to be conformant in an implementation of PC [1] URL:http://dev.opera.com/articles/view/opera-widgets-specification-1-0-third-ed-2/#xml_widgetfile_element [2] Should be testable both in Opera 9.6x and the upcoming Opera 10.00 -- Arve Bersvendsen Developer, Opera Software ASA, http://www.opera.com/
Re: SVG as Widget Icon
Hi Doug, On Thu, Jan 29, 2009 at 5:28 PM, Doug Schepers schep...@w3.org wrote: Hi, Marcos- Marcos Caceres wrote (on 1/29/09 7:53 AM): On Wed, Jan 28, 2009 at 6:59 PM, Doug Schepers schep...@w3.org wrote: I think that rather than specifying a particular spec or profile, the Widgets spec should instead reference a feature set that is appropriate for use as a icon. Ok, we want to keep this as the authoring level as to not force implementations to have to ship with stripped down SVG renderers. 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? My recommendation is that you include normative references not only to SVG Tiny 1.1, but also SVG Full 1.1 (which is largely implemented in desktop browsers, and probably has the most current implementations), and SVG Tiny 1.2 (which is the most recent SVG Rec, and is deployed most widely on mobiles). ... particular needs and use cases, but in the meantime, I think the best thing would be to outline what capabilities should and should not be allowed for presenting an SVG icon. Specifically, static image rendering must (or should) be required, but for security reasons, no script and no interaction (not even linking) should be allowed; however, declarative animation should be allowed, so that authors can provide animated icons (assuming the UA supports it... right now, FF doesn't, but should soon). It is rather more questionable whether video or audio should be allowed, or things like HTML embedded in foreignObject (which seems okay to me). ... the Widgets spec should describe these constraints explicitly (if briefly), referencing these featurestrings: ... If you would like me to work up proposed spec text, I could oblige you. That would be great! The relevant sections are: http://dev.w3.org/2006/waf/widgets/#dependencies-on-other-specifications-and-file-formats http://dev.w3.org/2006/waf/widgets/#custom-icons-and-default-icons Okay, give me a practical deadline that is after next week. No probs. I'll ping you in a week. -- Marcos Caceres http://datadriven.com.au
Re: SVG as Widget Icon
Marcos Caceres wrote: Hi Doug, On Thu, Jan 29, 2009 at 5:28 PM, Doug Schepers schep...@w3.org wrote: Hi, Marcos- Marcos Caceres wrote (on 1/29/09 7:53 AM): On Wed, Jan 28, 2009 at 6:59 PM, Doug Schepers schep...@w3.org wrote: I think that rather than specifying a particular spec or profile, the Widgets spec should instead reference a feature set that is appropriate for use as a icon. Ok, we want to keep this as the authoring level as to not force implementations to have to ship with stripped down SVG renderers. 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? Disabling features for security reasons is something that I'm all for. I've always had a funny feeling that that svg:use guy is up to no good! We should disable him promptly! ;) Seriously though. Disabling scripting is something we should definitely do. We haven't yet added support to gecko to truly treat SVG as images, i.e. you can't point an img or a css background on an SVG image. But once we do implement that, we plan on running it in a mode where all forms of scripting is disabled. We should recommend, or require, that this happens for for the icon as well. This is however very different from running it in a context where sets of elements are disabled to match closer the SVG Tiny 1.2 specification. / Jonas
Re: SVG as Widget Icon
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. -Boris