Re: [css3-images] Using SVG Paint Servers as <image>

On Thu, Jul 14, 2011 at 5:15 AM, Alan Gresley <alan@css-class.com> wrote:
> On 14/07/2011 2:40 PM, Robert O'Callahan wrote:
>> On Thu, Jul 14, 2011 at 1:13 PM, Tab Atkins
>> Jr.<jackalmage@gmail.com>wrote:
>>> Second, how should paint servers be referenced?  In roc's old code,
>>> you simply used url(), with the fragment pointing to the paint
>>> server's id.  More recently, though, roc has suggested using
>>> element(), extending it to take a url.  I'm not so much a fan of this
>>> latter solution; for one, it's confusing to have both an idselector
>>> and a url with a fragid, as they'll refer to different things -
>>> element(#foo) refers to the element with id=foo in the host document,
>>> while element("#foo") would refer to the element with id=foo in the
>>> CSS document (which wouldn't refer to anything at all if the CSS was
>>> external).
>
>
> I don't follow Tab. A url string can be both (#foo) and ("#foo"). Are you
> saying that the later can refer to an identifier in a CSS document like #foo
> { ... }?

Not quite.  The url() function allows both quote and unquoted urls.  I
wasn't very clear in my message, but I'd only allow quoted urls if I
allowed them in element() (because otherwise it's ambiguous with the
other possible values).

element(#foo) refers to the element with id=foo in the host document
(like the HTML document that links to the CSS).  url(#foo) refers to
the element with id=foo in the current document.  If that appears in
an external CSS file, it obviously doesn't refer to anything, as CSS
files don't have a DOM like that.  If it appears inline in a <style>
block, it would refer to the appropriate element in the document.

~TJ

Received on Thursday, 14 July 2011 20:48:47 UTC