W3C home > Mailing lists > Public > www-style@w3.org > May 2008

Re: [CSS2.1] syntax: url() and unexpected end of (line / style sheet)

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 14 May 2008 12:27:29 -0700
To: Zachary Weinberg <zweinberg@mozilla.com>
Cc: Christof Hoeke <csad7@t-online.de>, www-style <www-style@w3.org>, Bjoern Hoehrmann <derhoermi@gmx.net>
Message-ID: <20080514192729.GA11416@pickering.dbaron.org>

On Wednesday 2008-05-14 12:16 -0700, Zachary Weinberg wrote:
> ----- "Christof Hoeke" <csad7@t-online.de> wrote:
> > 
> > the question remains *why* URI is a token and why the definition for 
> > FUNCTION is not used instead, it would actually simplify the tokenizer
> > as well.
> 
> Yeah, I would like to know that myself - but even if it remains
> a token, it could be changed to use the same completion rules as
> FUNCTION.

I suspect the rationale for it being a token was to allow the whole
thing to appear as something simple to parse (i.e., not a long and
complicated sequence of tokens) without requiring authors to put the
contents of url() inside quotation marks (which would make it into a
single string token.

> > I always explained it to myself that if an URI is cut off it may be 
> > totally different than the value meant and so better be removed 
> > altogether (contrived examply: e.g. "url(some.gif.jpg)" could be cut 
> > e.g. "url(some.gif" and if the completion rule of FUNCTION would be
> > used would end up "url(some.gif)"...)
> 
> This argument can be applied to *all* constructs not
> properly closed at EOF.  E.g. rgb(12,12,12<EOF> maybe should have been
> rgb(12,12,129) which is a very different color.

Allowing constructs that were unclosed to be valid when terminated
by EOF is new in CSS 2.1 (I think mainly for compatibility with
existing browsers other than Gecko); I don't think that was part of
the design rationale.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Wednesday, 14 May 2008 19:28:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:06 GMT