Re: [css3-images] Image Fragments and SVG URIs

On Sat, Jun 30, 2012 at 9:56 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> Dirk Schulze:
>> What happens if the element has 'xywh' as id? Would it be interpreted as
>> URI or media fragment identifier?
>
> All of the media fragments seem to have the form <name>=<value>, so I would
> expect something.svg#xywh to have the normal SVG linking behaviour.

Yes, you should still be able to link to, say, an element with id='t',
without conflicting with t=... Media Fragment syntax.

> What might have been an issue is if there is an element with
> id="xywh=1,2,3,4" for example, but SVG fragment identifiers are already
> defined to be an XML Name, not an arbitrary string, so
> something.svg#xywh=1,2,3,4 would presumably not end up referencing any
> element anyway.

If this kind of id is already invalid in SVG, great.  If not, I think
it would be useful to explicitly rule out these kinds of ids, so that
the target syntax can be extended by other specs in the future like
Media Fragments.

On Sun, Jul 1, 2012 at 3:14 AM, Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de> wrote:
> Dirk Schulze:
>>The example for 'Image Fragments' [1] on the CSS3 images spec has an example
>>for media fragment identifiers:
>>
>>       background-image: image('sprites.svg#xywh=40,0,20,20')
>>
>>#xywh is the media fragment identifier. This is clearly in conflict with
>>SVG's URI for references [2]. URIs make it possible to target elements by id
>>within an SVG image.
>
> SVG has already functionalities for such applications defined:
> http://www.w3.org/TR/SVG/linking.html#LinksIntoSVG
> Because this is already a recommendation, it will be more
> useful to hamonise other drafts with SVG instead of introducing
> potentially incompatible new syntax for something, that already
> works. There is no need to reinvent the wheel here ;o)
>
> http://dev.w3.org/csswg/css3-images/#image-fragments
> should note something like this:
> background-image: image('sprites.svg#svgView(viewBox(40,0,20,20)))
> to get the intended and recommended behaviour and should reference
> the SVG section with the more general concept, to be able to note other
> parameters as well as the intended aspect ratio, additional transformations
> etc.

Media Fragments were designed for arbitrary media. It wouldn't make
much sense to use something named "svgView()" on a PNG, after all.
^_^  Even if it duplicates existing specced functionality in SVG, it
would be nice if MF syntax worked on SVG as well as raster images.

~TJ

Received on Thursday, 5 July 2012 00:48:00 UTC