Re: Ambiguities in fill:url() / stroke:url() syntax

Here's an alternative proposal:

Given a url() value in a context whether either an external resource
reference (e.g. paint server reference) or an image load (e.g. SVG image)
could be performed,
a) If the resolved URI uses a Media Fragments URI feature, or the svgView
feature (http://www.w3.org/TR/SVG/linking.html#LinksIntoSVG), perform an
image load.
b) otherwise, if the resolved URI includes a fragment identifier, perform
an external resource reference.
c) otherwise, perform an image load.
URIs in image() values always perform an image load. URIs in element()
values always perform an external resource reference.

I think this proposal almost always does what the author wants, and is
compatible with almost all existing usage, while being very simple. The
only problematic case is that url(foobar.svg#abc) can no longer be used to
link to a specific element in an SVG file; image(foobar.svg#abc) must be
used instead. I think the usage of that feature is currently very low and
can probably be broken, at least if we do it soon.

Some fine-tuning of this proposal could be done. For example we might
modify step a) to treat any URI with a fragment identifier containing
certain characters (e.g. '=', '(', ')') as an image load, so that Media
Fragments-like features can be introduced later without potentially
changing behavior.

Rob
-- 
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’
But I tell you, love your enemies and pray for those who persecute you,
that you may be children of your Father in heaven. ... If you love those
who love you, what reward will you get? Are not even the tax collectors
doing that? And if you greet only your own people, what are you doing more
than others?" [Matthew 5:43-47]

Received on Saturday, 27 October 2012 10:26:51 UTC