W3C home > Mailing lists > Public > www-style@w3.org > October 2012

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

From: Robert O'Callahan <robert@ocallahan.org>
Date: Sat, 27 Oct 2012 23:26:22 +1300
Message-ID: <CAOp6jLazpay20yDU3F2nTx_A9n=Hw6uiAJ-L2BP8GcLVbpWkzg@mail.gmail.com>
To: Dirk Schulze <dschulze@adobe.com>
Cc: www-svg <www-svg@w3.org>, www-style <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:01 GMT