Re: [css3-background] lookahead and 'background' shorthand parsing

On Mon, 15 Sep 2008 00:39:57 +0200, L. David Baron <dbaron@dbaron.org>  
wrote:
> I noticed that in the parsing of the 'background' shorthand in
> http://dev.w3.org/csswg/css3-background/#background1 , the parsing
> requires two token lookahead, which current CSS parsing rarely, if
> ever, requires.  In particular, when a '/' is encountered, it's not
> possible to tell whether that '/' is the delimiter in the middle of
> the background-color or whether it's the beginning of the
> background-size without looking at the next token:
>
>   background: blue / black; /* background-color */
>   background: blue / cover; /* background-color background-size */
>
> One way to solve this would be to require 'background-position' in
> order to specify 'background-size'.
>
> (It's possible we could decide it's worth the complexity, although I
> wouldn't be too happy about that.)

I thought we decided that background-size would be enclosed by parenthesis  
in the background shorthand. The various examples reflect this, but the  
grammar apparently does not. (No idea what WebKit supports here though.)


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Monday, 15 September 2008 09:43:38 UTC