Re: draft-ietf-html-style-00.txt & class as a general selector

lilley (lilley@afs.mcc.ac.uk)
Thu, 7 Dec 1995 19:48:01 +0000 (GMT)


Chris Wilson> said:

> Chris Lilley wrote:
> > h&kon said:
> > > [CLASS="foo"] { color: blue }
> >What purpose do all the [] and "" serve in the first example?

> The [] encapsulation makes it a little easier to parse;

OK, in the sense that the [ token distinguishes an attribute name from
a (fictional) element name called CLASS, I agree that this makes parsing
easier. And indeed, is better than schemes where the token follows the
string, so that as you read the string you don't know what is is.

So in this example, [ is exactly equivalent to my use of @. It means
that an attribute value is coming.

An equals sign is used identically in both cases. It delimits an
attribute name from the attribute value. Fine.

The ] does not make it easier to parse. The end of the attribute
value and the start of the declaration are clearly delimited by
the {

This was my point; people are just tossing in random bits of
punctuation "we could write this" well so we could, but what do
the component parts mean?

> the quotes, in that example, are unnecessary.

Right.

> >In the third example, . means "a class called" but this does not seem
> >to scale well, particularly when CSS is later used for other DTDs which
> >might not have a class attribute (or might have one that means something
> >else)
>
> Ah, but the class attribute specification is obviously not meant to scale.

Why not?

> >So, for generality and a clear upgrade path to CSS 2 how about some
> >token to say, here is an attribute, and another token to say, here is
> >it's value. Let's use @ and = for these, though the representation
> >could be some other token. I just thought @ (at) was memorable for
> >"attribute" and = seemed obvious for "has the value"

> ? I thought there was already a "proposal" for generalized attribute
> selection - the [attribute=value], or just [attrib] for existence, format.

Yes. I was saying that some of the tokens in there are superfluous. I made
another proposal. This also had the advantage of being clear that a.b was
a short form of the generic syntax I proposed, which can be applied to other
SGML DTDSs in addition to HTML. It regularises things.

> That was, I believe, the point of making "[ID=value]" so complex in
> comparison (I don't know why we didn't just do "[CLASS=foo]" from the
> beginning - perhaps we should?

To make them more consistent? Fine. Although, as I say, the trailing
square bracket is not doing anything.

-- 
Chris Lilley, Technical Author and JISC representative to W3C 
+-------------------------------------------------------------------+
|  Manchester and North Training & Education Centre   ( MAN T&EC )  |
+-------------------------------------------------------------------+
| Computer Graphics Unit,             Email: Chris.Lilley@mcc.ac.uk |
| Manchester Computing Centre,        Voice: +44 161 275 6045       |
| Oxford Road, Manchester, UK.          Fax: +44 161 275 6040       |
| M13 9PL                            BioMOO: ChrisL                 |
| Timezone: UTC        URI: http://info.mcc.ac.uk/CGU/staff/lilley/ | 
+-------------------------------------------------------------------+