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

Re: Allow whitespace before the commas?

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 8 Dec 2008 20:47:27 -0800
To: fantasai <fantasai.lists@inkedblade.net>
Cc: Krzysztof MaczyƄski <1981km@gmail.com>, www-style@w3.org, Bert Bos <bert@w3.org>
Message-ID: <20081209044727.GA14604@pickering.dbaron.org>

On Monday 2008-12-08 20:11 -0800, fantasai wrote:
> There are several places where white space seems to have been
> left out of the grammar.
>
> Unless I'm missing something we need to replace
>   : selector [ COMMA S* selector ]*
> with
>   : selector [ S* COMMA S* selector ]*
> and
>   : PLUS S* | GREATER S* | TILDE S* | S+
> with
>   : S* PLUS S* | S* GREATER S* | S* TILDE S* | S+
>
> Bert or dbaron, could you check that? If it's correct I'll
> edit these changes into the spec.

That seems correct, although insufficient (see below).  However, I
think it fits better with the existing style to instead have the
whitespace at the end of the simple_selector production.  (Might
there also be technical reasons for preferring the
whitespace-at-end-of-production habit?  Doing that at least often
has helpful affects of propagating the allowance of whitespace up to
other productions.)

In other words, instead of the above two changes, change:
  # simple_selector
  #   : element_name [ HASH | class | attrib | pseudo ]*
  #   | [ HASH | class | attrib | pseudo ]+
  #   ;
to be either:
  # simple_selector
  #   : element_name [ HASH | class | attrib | pseudo ]* S*
  #   | [ HASH | class | attrib | pseudo ]+ S*
  #   ;
or probably preferably:
  # simple_selector
  #   : [ element_name [ HASH | class | attrib | pseudo ]* |
  #       [ HASH | class | attrib | pseudo ]+ ] S*
  #   ;

Having optional whitespace at the end of simple_selector would both
fix the combinator issue and ensure that there is also optional
whitespace at the end of selector.   It would also fix the third bug
that the current Appendix D grammar does not allow whitespace
between the selector and the "{" to begin the ruleset.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Tuesday, 9 December 2008 04:48:10 GMT

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