Re: identifiers

--- Bill dehOra <Wdehora@cromwellmedia.co.uk> wrote:
> Hi,
> 
> is this a legal identifier in CSS?:
> 
> 	:foo
Yup.

simple_selector
  : element_name? [ HASH | class | attrib | pseudo ]* S*
  ;

where pseudo is:
pseudo
  : ':' [ IDENT | FUNCTION S* IDENT S* ')' ]
  ;

and foo is a valid IDENT because it doesn't contain any ASCII characters
other than a-z A-Z 0-9 and - and does not start with - or 0-9.

Also relevant is:

<blockquote cite="http://www.w3.org/TR/REC-CSS2/conform.html#q1">
A valid CSS2 style sheet must be written according to the grammar of CSS2.
Furthermore, it must contain only at-rules, property names, and property
values defined in this specification. An illegal (invalid) at-rule,
property name, or property value is one that is not valid. 
</blockquote>

This statement is ever so slightly ambiguous, but it means that _in
addition to being grammatically correct, there is the additional
constraint that at-rules, property names and values must be valid CSS-2.

As a result since :foo, P {color: red} is grammatically correct, it should
not be ignored (where the criterion for ignoring is:

<q cite="http://www.w3.org/TR/REC-CSS2/syndata.html#q8">
When a user agent can't parse the selector (i.e., it is not valid CSS2),
it must ignore the {}-block as well.
</q>
)
Conversely, :1foo, P {color: red} should be ignored because :1foo cannot
be  parsed. Similarly :foo:cheese, P, although valid CSS-2, should be
ignored by CSS-1 browsers. 

The only difficulty here is 'What is a CSS-1 browser?'.
For example, Opera 3.6 supports * (albeit with very bad bugs), + (albeit
with bugs affecting non-trivial cases), > (albeit with a trivial bug),
multiple classes and @import with media (albeit with a bug). However, it
doesn't support multiple pseudos - I feel it should probably ignore them
because it does not support the relevant area of CSS but who knows for
sure.


=====
----------------------------------------------------------
From Matthew Brealey (http://members.tripod.co.uk/lawnet (for law)or http://members.tripod.co.uk/lawnet/WEBFRAME.HTM (for CSS))
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Received on Wednesday, 9 February 2000 08:44:44 UTC