W3C home > Mailing lists > Public > www-style@w3.org > July 2000

css identifier parsing bugs, escapes in classnames

From: Daniel W. Connolly <connolly@w3.org>
Date: Wed, 19 Jul 2000 03:54:49 -0400
Message-Id: <200007190754.DAA15801@tux.w3.org>
To: css-test@w3.org, www-amaya@w3.org, www-style@w3.org
The text of the paragraph in the following document
should be purple, no?

<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css">
p.a\:b { color: purple }
<p class="a:b">aslkfj</p>

HTML 4 doesn't exactly say what the syntax of a class name

"class = cdata-list [CS] 
                This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned
                the same class name or names. Multiple class names must be separated by white space characters. "

  -- http://www.w3.org/TR/html4/struct/global.html#adef-class

but the CSS specs are pretty clear that identifiers can
contain excape gizmos:

"In CSS2, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [A-Za-z0-9] and
      ISO 10646 characters 161 and higher, plus the hyphen (-); they cannot start with a hyphen or a digit. They can also contain
      escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may
      be written as "B\&W\?" or "B\26 W\3F".  "

 -- http://www.w3.org/TR/REC-CSS2/syndata.html#keywords

I don't see a relevant test in the test suite.

Please add one.

perhaps in "Class as selector"

Are there *any* implementations that get the identifier
parsing in CSS right? I tried Netscape 4 and IE 4
and Opera 4 and Amaya and they all failed.

I can see that the relevant Amaya code doesn't implement
the escape codes: the only occurrence of '\' in
the code is to handle strings.
 1.59 Tue Jun 27 11:19:46 2000 UTC

Ah... flute seems to grok.

1.12 Wed Apr 19 21:59:52 2000 UTC

Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Wednesday, 19 July 2000 03:54:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:54 UTC