W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: [css-style-attr] Update and grammar question

From: Bert Bos <bert@w3.org>
Date: Wed, 13 Jan 2010 20:17:48 +0100
To: "www-style@w3.org" <www-style@w3.org>
Message-Id: <201001132017.49207.bert@w3.org>
On Thursday 07 January 2010, fantasai wrote:
> I've updated some of the wording in the draft in response to comments
> from Hixie wrt html5 spec integration and missing normative
> requirements. Since the comments were over IRC and not logged, I
> stuffed them in the CVS logs:
> http://dev.w3.org/cvsweb/csswg/css-style-attr/Overview.src.html?rev=1
> That aside, I was wondering if it's possible to merge the two grammar
> productions, i.e.
>   <pre>
> -inline-stylesheet
> -  : S* declaration-list
> -  ;
> -
>   declaration-list
> -  : declaration [ ';' S* declaration ]*
> +  : S* declaration [ ';' S* declaration ]*
>     ;
>   </pre>
> I don't know enough about the grammar's "good style" to say. Bert?

The grammars in CSS 2.1 are bigger than this one and making sure that 
they are neither missing S tokens nor have redundant ones is tricky. 
That's not an issue in this much simpler draft.

But there is some confusion between sections 3 and 4. Both claim to 
define the syntax. I think we should merge them into a single section. 
That could be like this:

    3. Syntax and Parsing

    The value of the styling attribute must match the syntax of the
    contents of a CSS declaration block[link], i.e.,

         declaration-list: S* declaration? [ ';' S* declaration? ]*;

    The interpreter must parse the styling attribute’s value using the
    same forward-compatible parsing rules that apply to parsing
    declaration block contents in a normal CSS style sheet. See
    chapter 4 of the CSS 2.1 specification. [CSS21]

    Note that because there is no open brace delimiting the declaration
    list in the CSS styling attribute syntax, a close brace (}) in the
    styling attribute's value does not terminate the style data: it is
    merely an invalid token.

And then drop section 4.

The link to appendix G is not needed, because there is already a link to 
chapter 4 and all symbols are defined there as well.

I wonder if it is useful to mention comments. The reference to chapter 4 
implies that comments can occur, but will all implementers notice that? 
A note like this might help:

    Note that comment tokens aren't shown in the grammar rule above,
    following the convention of chapter 4 of CSS 2.1.

  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Wednesday, 13 January 2010 19:18:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:42 UTC