W3C home > Mailing lists > Public > public-fx@w3.org > April to June 2011

Re: [css3-images] Defining SVG paint servers as a CSS <image>

From: Erik Dahlstrom <ed@opera.com>
Date: Wed, 29 Jun 2011 11:17:28 +0200
To: "Rik Cabanier" <cabanier@gmail.com>, "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: public-fx@w3.org
Message-ID: <op.vxtyrev4geuyw5@localhost.localdomain>
On Wed, 22 Jun 2011 02:53:12 +0200, Tab Atkins Jr. <jackalmage@gmail.com>  

> On Tue, Jun 21, 2011 at 1:56 PM, Rik Cabanier <cabanier@gmail.com> wrote:
>> On Tue, Jun 21, 2011 at 1:12 PM, Tab Atkins Jr. <jackalmage@gmail.com>
>> wrote:
>>> On Tue, Jun 21, 2011 at 12:19 PM, Rik Cabanier <cabanier@gmail.com>  
>>> wrote:
>>> > It would even be better if there was a way that you could refer to a  
>>> SVG
>>> > symbol instead of a paint server.
>>> > We're working on converting Flash content to HTML+SVG and if the
>>> > animation
>>> > is complex, we create many external SVG files.
>>> > The size of the SVG files is not a problem but having to do a http
>>> > request
>>> > for each one causes a lot of overhead.
>>> > If we could refer to symbols, we could put all our content in 1  
>>> external
>>> > file which is much more efficient...
>>> That's theoretically doable by just targetting <svg> subelements
>>> directly, right?
>> Correct but it requires JavaScript to make it work.
> Hmm, you miss my point.  The ability to refer to a single sub-<svg> of
> a larger SVG is part of the spec, right?  I think nobody does it, but
> I'll assume for now that it's something that can be fixed.

I think Firefox has some support of this for the 'background' property  
when used with SVG images, correct me if I'm wrong. I don't think all  
aspects of that is defined, e.g what coordinate space to use if you  
reference a sub-svg. Also see the fragment syntax defined for svg[1]. If  
that syntax applies then you could use one svg with several views defined  
as an option.

One thing to note is that unless the url was absolute it would be resolved  
against the base location of the stylesheet (which isn't always what you  
want), e.g background: (some.svg#foo) will only work if the file is in the  
right place. It might be nice to be able to mix the svg content into the  
html file and to reference the svg parts from a stylesheet without having  
to specify the file/location.

[1] http://www.w3.org/TR/SVG11/linking.html#LinksIntoSVG

Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Wednesday, 29 June 2011 09:18:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:38 UTC