Re: curly brackets within STYLE attribute

Daniel Glazman writes:
> Yvonne Throgmorton wrote:
> > 
> > Mac IE and Win IE parse and render the following:
> > 
> >         <BODY STYLE="{color: red}">
> > 
> > While the specification doesn't say this is illegal, I never recall seeing
> > an example of the STYLE attribute used this way in documentation or in test
> > suites and was wondering what you think.
> 
> Eh eh, what a catch Yvonne ! It is not illegal, it is the only legal
> way to specify a STYLE attribute !-(

Yes, this one seems to have slipped through the cracks.

On the one hand, there isn't a single working draft or other page on
the W3C site that has, or has ever had, curly braces. The thought
simply has never crossed our minds that people might put them in.

On the other hand, the CSS WG thought it didn't have to specify this,
because it was part of HTML, while the HTML WG thought it didn't have
to specify this, because it was part of CSS...

I guess, after all, the CSS spec should have defined it. All it
currently has is examples, such as 6.4.3[1]. Same for CSS1, see
section 1.1[2].

[1] http://www.w3.org/TR/REC-CSS2/cascade.html#specificity
[2] http://www.w3.org/TR/REC-CSS1#containment-in-html

> Errata, IMHO.... The spec should mention that the value of the style
> attribute is a list of declarations separated by semi-colons, not a
> rule w/o selectors. Bert ?

I agree.

So where shall we put it? Chapter 4 is about syntax, it could go in
there. For example as section 4.4 (current 4.4 becomes 4.5):


    4.4 CSS and HTML's "style" attribute

    HTML allows style properties to be attached directly to most
    elements, via the "style" attribute. When CSS is used as the
    language for these attributes, the attribute value must be a
    semicolon-separated list of declarations. More precisely:

        style-value : S* declaration? [ ';' S* declaration? ]*;



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 15 September 1999 12:54:15 UTC