W3C home > Mailing lists > Public > www-validator-css@w3.org > January 2003

valid and invalid declaration expressions (peculiar)

From: Alex Geller <alexgeller@web.de>
Date: Tue, 21 Jan 2003 11:35:04 -0500 (EST)
Message-Id: <200301211634.h0LGYWO15682@mailgate5.cinetic.de>
To: www-validator-css@w3.org




Hi,
consider the following two rules:
      A { margin-top:12pt+2pt }
      B { margin-top:12pt-2pt }
While the first rule is accepted, the second is rejected saying "Unknown dimension : 12pt-2pt".
Is 12pt+2pt a known dimension then?
The reason for this behaviour is the grammar. Here the relevant part:
expr
  : term [ operator term ]*
  ;
term
  : unary_operator?
    [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
      TIME S* | FREQ S* | function ]
  | STRING S* | IDENT S* | URI S* | RGB S* | UNICODERANGE S* | hexcolor
  ;
operator
  : '/' S* | ',' S* | /* empty */
  ;
{num}{ident}		{return DIMEN;}
The first expression is resolved as:
expr
    term
        LENGTH 12pt
    term
        unary_operator +
         LENGTH 2pt
While the second yields:
expr
    term
        DIMEN 12pt-2pt
hence the strange behaviour.
BTW the validators pretty printer does not output the additional terms. The rule:
      C { margin-top:-10%/12pt,12pt+12pt 12pt }
is accepted as beeing valid but the output is stripped to:
C {
margin-top : -10%; 
} 


______________________________________________________________________________
Keinen passenden Spruch für die SMS parat? Mit WEB.DE FreeMail 
kein Problem mehr! http://freemail.web.de/features?mc=021149
Received on Tuesday, 21 January 2003 15:56:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 00:14:11 GMT