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

Re: [CSS21] Conflict between source text and example in section 4.2

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 19 Oct 2006 23:31:19 -0700
To: www-style@w3.org
Message-ID: <20061020063119.GA10346@ridley.dbaron.org>
On Thursday 2006-10-19 22:31 -0600, Rainer Ahlfors wrote:
> The last bullet under 4.2 (Rules for handling parsing errors) reads:
> ------------------------------------------------------------------------
> -------
> Unexpected end of string.
> User agents must close strings upon reaching the end of a line, but then
> drop the construct (declaration or rule) in which the string was found.
> For example: 
>  
>       p {
>        color: green;
>        font-family: 'Courier New Times
>        color: red;
>        color: green;
>      }
>  
> ...would be treated the same as: 
>  
>       p { color: green; color: green; }
>  
> ...because the second declaration (from 'font-family' to the semicolon
> after 'color: red') is invalid and is dropped.
> ------------------------------------------------------------------------
> -------
>  
> There appears to be a clear conflict between the statement "upon
> reaching the end of a line" and the subsequent example with explanation
> "the second declaration (from 'font-family' to the semicolon after
> 'color: red')." In other words -- is this rule meant to actually mean
> "end of a line" or should it instead be taken to mean "end of a line or
> declaration block, whichever comes first" instead?

I see no conflict.  The example rule contains three declarations:

(1)
  color: green;

(2)
  font-family: 'Courier New Times
  color: red;

(3)
  color: green;

The second declaration has an unclosed string.  The unclosed string
ends at the end of the line.  This means this second declaration
consists of the following tokens:

  IDENT: font-family
  DELIM: :
  S
  INVALID: 'Courier New Times
  S
  IDENT: color
  DELIM: :
  S
  IDENT: red
  ;

Because this declaration has an unclosed string (tokenized as
INVALID), it is dropped without any further parsing of its structure.

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Received on Friday, 20 October 2006 06:31:42 GMT

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