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

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.)


L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Sunday, 14 September 2008 22:40:39 UTC