W3C home > Mailing lists > Public > www-svg@w3.org > July 2012

[css3-images] Image Fragments and SVG URIs

From: Dirk Schulze <dschulze@adobe.com>
Date: Sat, 30 Jun 2012 20:37:01 -0700
To: "www-style@w3.org list" <www-style@w3.org>
CC: "www-svg@w3.org list" <www-svg@w3.org>
Message-ID: <04CE728E-B06A-49E0-8A0E-DA65F411ACF0@adobe.com>
Hi CSS and SVG WGs,

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.

As an example, the HTML fragment below embeds an SVG file as follows:

	<object data="sprites1.svg#reference"></object>

With the SVG file (shortened):

		* {display: none;}
		#reference:target {display:inline;}
	<rect id="reference" width="100" height="100" fill="green"/>
	<circle cx="50" cy="50" r="50" fill="red"/>

As a result, just the green rectangle gets visible, since it is the targeted.

What happens if the element has 'xywh' as id? Would it be interpreted as URI or media fragment identifier?

Note: Media Fragments URI already noticed this conflict, and recommends that all specs harmonize with Media Fragment URI. Which is not the case for SVG till now [3]. We might have a chance to correct it in SVG 2.0 but with lost of backwards compatibility. I saw at least a couple of examples that use 't' as id. On harmonizing, these elements could not be referenced by fragment identifier any more. In the meantime, this conflict exists for CSS3 images as well.


[1] http://dev.w3.org/csswg/css3-images/#image-fragments
[2] http://www.w3.org/TR/SVG/linking.html#IRIandURI
[3] http://www.w3.org/TR/media-frags/#standardisation-URI-fragments
Received on Sunday, 1 July 2012 03:37:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:36 UTC