- From: Rainer Ahlfors <rahlfors@wildcatsoftware.net>
- Date: Fri, 20 Oct 2006 02:12:29 -0600
- To: "L. David Baron" <dbaron@dbaron.org>, <www-style@w3.org>
- Message-ID: <8527943F19DEA542A0D2AC7263A8481E010F8F0B@DENALI.OUTDOORS.geartrade.com>
Thank you for your clarification. It does make sense now. I guess it was
just not as clear as one would wish.
 -----Original Message----- 
 From: L. David Baron 
 Sent: Fri 10/20/2006 12:31 AM 
 To: www-style@w3.org 
 Cc: 
 Subject: 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 08:12:48 UTC