Re: Multiple Background Images

> Hi, Ted, seems I am getting your point :)
>
> 1) To create SVG on the server we can use
> url(svg.cgi?bg1=foo&bg2=bar) as is. So our server will take
> parameters provided and synthesize some SVG for us.

This should be fine for the server side.

> 2) To modify SVG on the client we may use SVG DOM manipulation using
> JavaScript
> DOM functions. This will work in SVG viewers with JavaScript enabled.

That should be a possibility, but I would prefer doing
it more like specifying url(svg.xml?bg1=foo&bg2=bar)
then using XPath in XSLT to extract "bg1=foo&bg2=bar" from
the dm:document-uri to generate any svg background that I want.

The svg.xml file would begin with a processing instruction specifying
<?xml-stylesheet type='text/xsl' href=...
which would trigger client-side xslt processing of the document.

Since the dm:document-uri accessor follows RFC-2396, the query
could be available to XPath for XSLT processing.  The XSLT can
generate SVG on the fly with any number of backgrounds.

CSS shouldn't need to bloat by duplicating support for
multiple background images if url(svg...) interfaces well.

> To be precise your question should sound like:
> "How to define in CSS and pass parameters into SVG's onLoad  [1]
> event handler?"

That's one aspect of it, but I only used JavaScript as an example
because it illustrates my point with an example that you can try
today.

> scope of
> url(...).

url only needs to know about one logical background image.
If the image can be svg (or dynamically created svg)
which can render layers of images, url(...) can be kept simple.

> PS: expectation that document.location will always reflect requested
> url is
> a bit optimistic.

Popular user agents correctly set document.location
in JavaScript, so I would hope that UAs will do the same
for XPath 2.0 dn:document-uri according to RFC 2396
as they upgrade to XPath2. (dn:document-uri was not in XPath1)

_-T

> | - The layering could be handled by SVG
> | - ... scalability ... by XSLT ...

Received on Tuesday, 16 November 2004 17:15:49 UTC