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

On Thursday 14 January 2010, fantasai wrote:
> On 01/13/2010 11:17 AM, Bert Bos wrote:
> > 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.
>
> Ok, I've updated the spec:
>    http://dev.w3.org/csswg/css-style-attr/#syntax
>
> How does that look?

Looks good, but shouldn't the grammar rule be

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

i.e., with two question marks? That's what CSS has and I think that's 
what we want here, too. Otherwise all of the following would be 
illegal:

    style=""
    style="; color: blue"
    style="color: blue;"
    style="color: blue;; margin: 1em"



Bert
-- 
  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 Monday, 18 January 2010 18:41:10 UTC