W3C home > Mailing lists > Public > www-style@w3.org > September 2008

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

From: L. David Baron <dbaron@dbaron.org>
Date: Sun, 14 Sep 2008 15:39:57 -0700
To: www-style@w3.org
Message-ID: <20080914223957.GA6271@pickering.dbaron.org>

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

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Sunday, 14 September 2008 22:40:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:12 GMT