Re: URLs in CSS

On Thu, 11 Apr 1996 11:38:40 +0200, you wrote:

>Several CSS properties take URL values. Up to now, URLs have been
>identified with quotes. This works quite well for absolute links:
>
>  BODY { background: "http://foo.com/png/marble" }
>
>However, relative links can be confusing:
>
>  BODY { background: "red" }  /* relative URL */
>  BODY { background: red }    /* color name */
>

Several repliers have stated that there should be no semantics
connected to quoted strings except grouping characters. According to
the formal grammar this quoting is necessary, if the quoted string
contains characters which would confuse the parser otherwise (e.g.
whitespace or ':').

So I think that all property values which are not identifiers,
numbers, percentages or lengths should be quoted.

But the example above shows the ambiguity arising in situatations
where both URLs and property names are allowed.

>Here are some suggestions for alternative schemes;
>
>  BODY { background: [http://foo/bar] }
>  BODY { background: url:http://foo/bar }
>  BODY { background: href:red }
>  BODY { background: url:red }
>  BODY { background: url(red) }
>  BODY { background: url(http://foo/bar) }
>

>Also, should the identification be optional for absolute URLs?:
>
>  BODY { background: http://foo/bar } 
>
>The syntax would still be nonambigous (assuming no color names with
>colon in them), but error recovery could be harder.
>

I see two solutions:
-	Specification of a 'method': 
	(Examples: 
		url "http://foo/bar"
		url red
		rgb 1.0 1.0 1.0
		rgb #0FFF00 (see my post on color values)
		cns red
	There would be a default method (cns for color values) and
	property names would have to be quoted only if they contain
	characters like '/', ':' or whitespace.),
-	Using special delimiters for URLs.

Regarding special delimiters: The suggestion to use the syntax
"<http:red>" (message by Abigail) is appealing, but the
counter-argument that this would irritate browsers (message by Chris
Wilson) is valid. So I think something like '[http://foo/bar]' should
be used.

However, this will cause problems if the attribute specification list
in selectors in CSS2 uses the same delimiter. The lexical scanner
cannot decide, wether '[foo]' is an attribute list or an URL.

Comments? 

Wolfgang Rieger
Buero fuer Software-Entwicklung           Email: rieger@bse.de
                                          WWW  : http://www.bse.de/
Rosenheimer Str. 214                      Phone: +49 89 497738	
81669 Munich, Germany                     Fax  : +49 89 497738

Received on Monday, 22 April 1996 08:57:20 UTC