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

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 UTC