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

On Tue, Jun 21, 2011 at 5:53 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> 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.


If it is part of the spec, I have not seen it.
Conceptually it would be identical to your proposal of "background:
url(doc.svg#mycooldrawing);" with 'mycooldrawing' defined as a symbol in
'doc.svg'.


> >> Alternately, it might be doable by a suitable interpretation of
> >> <pattern>.  By default, I'd treat a <pattern> as an infinite image
> >> constructed from positioning and tiling the contents.  Alternately, we
> >> could treat <pattern> as just its contents, and leave the tiling part
> >> to CSS.  That would be a bit more magical than I probably want to
> >> worry about, though.
> >
> > Yes, using patterns feels more like a hack.
> > I agree that for your proposal, patterns should either not tile or be
> > excluded as a paint server.
>
> I was actually saying the opposite - patterns should indeed tile,
> because that's how they're defined in SVG.  My definition would just
> have them tile into the canvas that CSS uses.  It was the non-tiling
> that was hacky and which I didn't want to do.


I was agreeing with this part of your proposal:
  >> we could treat <pattern> as just its contents, and leave the tiling
part to CSS.

The tiling as defined by SVG should be ignored and replaced by tiling as
defined by CSS.

Received on Wednesday, 22 June 2011 02:11:41 UTC