[css3-images] Image Fragments and SVG URIs

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:40 UTC