Skip to content

Commit c1ea4c0

Browse files
committed
[dbaron revision history] Address some of Bjorn's comments. (date: 2003/07/29 04:40:46)
1 parent dd0f0db commit c1ea4c0

1 file changed

Lines changed: 53 additions & 50 deletions

File tree

css3-syntax/Overview.src.html

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
<h1>CSS3 module: Syntax</h1>
3232

33-
<h2 class="no-num no-toc">W3C Working Draft, [DATE: 16 July 2003]</h2>
33+
<h2 class="no-num no-toc">W3C Working Draft, [DATE: 28 July 2003]</h2>
3434
<dl>
3535
<dt>This version:</dt>
3636
<dd><a
@@ -118,16 +118,16 @@ <h2>Introduction</h2>
118118
<p>This specification describes the basic syntax of CSS3 and the syntax
119119
conventions used in the property definitions spread through the CSS3
120120
modules. The syntax of CSS3 has some error-handling requirements for
121-
forward-compatibility, but much of the error-handling behavior is
122-
user-agent dependent.</p>
121+
forward-compatibility, but much of the error-handling behavior depends
122+
on the user agent.</p>
123123

124124
<h2>CSS style sheet representation</h2>
125125

126126
<p>A CSS style sheet is a sequence of characters from the Universal
127127
Character Set (see [[!ISO10646]]). For transmission and storage, these
128128
characters must be <span class="index-def" title="character
129129
encoding">encoded</span> by a character encoding that supports the set
130-
of characters available in US-ASCII (e.g., ISO 8859-x, SHIFT JIS, etc.).
130+
of characters available in US-ASCII (e.g., ISO-8859-x, Shift_JIS, etc.).
131131
A <span id="BOM" class="index-inst">byte order mark (BOM)</span>, as described in
132132
section 2.7 of [[!UNICODE310]], that begins the sequence of characters
133133
should not be considered, for purposes of applying the grammar below, as
@@ -197,8 +197,15 @@ <h2>CSS style sheet representation</h2>
197197
EBCDIC. This means that in general, the initial byte values of a
198198
style sheet enable a user agent to detect the encoding family reliably,
199199
which provides enough information to decode the @charset rule, which
200-
in turn determines the exact character encoding.
200+
in turn determines the exact character encoding.</p>
201201

202+
<div class="issue">[Should this specification describe how to handle
203+
encoding errors? Can a user agent ignore the <code>@charset</code> rule
204+
if it's wrong? What if the user agent does not support the encoding
205+
used? Should this specification describe how to handle a
206+
<code>@charset</code> rule that specifies a character encoding that is
207+
incompatible with the family of encodings used to decode the
208+
<code>@charset</code> rule (and BOM) itself?]</div>
202209

203210
<!-- More examples of good encodings to use? -IJ -->
204211

@@ -284,70 +291,73 @@ <h3 id="characters">Characters and case</h3>
284291
<p> The following rules always hold:</p>
285292

286293
<UL>
287-
<LI> All CSS style sheets are <span class="index-inst" title="case
294+
<li><p>All CSS style sheets are <span class="index-inst" title="case
288295
sensitivity">case-insensitive</span>, except for parts that are
289296
not under the control of CSS. For example, the case-sensitivity of
290297
values of the HTML attributes "id" and "class", of font names, and
291298
of URIs lies outside the scope of this specification. Note in
292299
particular that element names are case-insensitive in HTML, but
293-
case-sensitive in XML.
300+
case-sensitive in XML.</p></li>
294301

295-
<LI> In CSS3, <span class="index-def"
302+
<li><p>In CSS3, <span class="index-def"
296303
title="identifier|identifier, definition of"><a
297304
name="value-def-identifier"><dfn>identifiers</dfn></a></span>
298305
(including element names, classes, and IDs in <a
299306
href="selector.html">selectors</a>) can contain only the
300307
characters [A-Za-z0-9] and ISO 10646 characters 161 and higher,
301-
plus the hyphen (-); they cannot start with a hyphen or a
302-
digit. They can also contain escaped characters and any ISO 10646
308+
plus the hyphen (-) and the underscore (_); they cannot start with a
309+
digit or a hyphen followed by a digit. They can also contain escaped
310+
characters and any ISO 10646
303311
character as a numeric code (see next item).
304-
<span class="example">For instance, the identifier "B&amp;W?" may
305-
be written as "B\&amp;W\?" or "B\26 W\3F".</span>
306-
<p>Note that Unicode is code-by-code equivalent to ISO 10646 (see
307-
[[!UNICODE310]] and [[!ISO10646]]).
312+
<span class="example">For instance, the identifier
313+
"<code>B&amp;W?</code>" may
314+
be written as "<code>B\&amp;W\?</code>" or "<code>B\26
315+
W\3F</code>".</span>
316+
(See [[!UNICODE310]] and [[!ISO10646]].)</p></li>
308317

309-
<LI> In CSS3, a backslash (\) character indicates three types of
318+
<li><p>In CSS3, a backslash (\) character indicates three types of
310319
<span class="index-def" title="backslash escapes">
311-
<a name="escaped-characters">character escapes</a></span>.
320+
<a name="escaped-characters">character escapes</a></span>.</p>
312321

313322
<p>First, inside a <a href="#strings">string</a>, a backslash
314323
followed by a newline is ignored (i.e., the string is deemed not
315-
to contain either the backslash or the newline).
324+
to contain either the backslash or the newline).</p>
316325

317326
<p>Second, it cancels the meaning of special CSS characters.
318327
Any character (except a hexadecimal digit) can be escaped
319328
with a backslash to remove its special meaning.
320329
For example, <samp>"\""</samp> is a string consisting of one
321330
double quote. Style sheet preprocessors must not remove
322331
these backslashes from a style sheet since that would
323-
change the style sheet's meaning.
332+
change the style sheet's meaning.</p>
324333

325334
<p>Third, backslash escapes allow authors to refer to characters
326335
they can't easily put in a style sheet. In this case, the backslash
327336
is followed by at most six hexadecimal digits (0..9A..F), which
328337
stand for the ISO 10646 ([[!ISO10646]]) character with
329338
that number. If a digit or letter follows the hexadecimal number,
330339
the end of the number needs to be made clear. There are two ways
331-
to do that:
340+
to do that:</p>
332341

333342
<ol>
334343
<li>with a space (or other whitespace character): "\26 B" ("&amp;B").
335344
In this case, user agents should treat a "CR/LF" pair
336345
(13/10) as a single
337-
whitespace character.
338-
<li>by providing exactly 6 hexadecimal digits: "\000026B" ("&amp;B")
346+
whitespace character.</li>
347+
<li>by providing exactly 6 hexadecimal digits: "\000026B" ("&amp;B")</li>
339348
</ol>
340349

341350
<p>In fact, these two methods may be combined. Only one whitespace
342351
character is ignored after a hexadecimal escape. Note that this means
343352
that a "real" space after the escape sequence must itself either be
344-
escaped or doubled.
353+
escaped or doubled.</p>
354+
</li>
345355

346-
<LI>Backslash escapes are always considered to be part of an <a
356+
<li><p>Backslash escapes are always considered to be part of an <a
347357
href="#value-def-identifier">identifier</a> or a string (i.e.,
348358
"\7B" is not punctuation, even though "{" is, and "\32" is allowed
349-
at the start of a class name, even though "2" is not).
350-
</UL>
359+
at the start of a class name, even though "2" is not).</p></li>
360+
</ul>
351361

352362
<h3 id="tokenization">Tokenization</h3>
353363

@@ -383,7 +393,7 @@ <h3 id="tokenization">Tokenization</h3>
383393
<tr><td id="SUBTOK-string">string <td>::=<td><code>'"' (<a href="#SUBTOK-stringchar">stringchar</a> | "'")* '"' | "'" (<a href="#SUBTOK-stringchar">stringchar</a> | '"')* "'"</code>
384394
<tr><td id="SUBTOK-stringchar">stringchar <td>::=<td><code><a href="#SUBTOK-urlchar">urlchar</a> | #x20 | '\' <a href="#SUBTOK-nl">nl</a></code>
385395
<tr><td id="SUBTOK-urlchar">urlchar <td>::=<td><code>[#x9#x21#x23-#x26#x27-#x7E] | <a href="#SUBTOK-nonascii">nonascii</a> | <a href="#SUBTOK-escape">escape</a></code>
386-
<tr><td id="SUBTOK-nl">nl <td>::=<td><code>#xA | #xD #xA | #xA | #xC</code>
396+
<tr><td id="SUBTOK-nl">nl <td>::=<td><code>#xA | #xD #xA | #xD | #xC</code>
387397
<tr><td id="SUBTOK-w">w <td>::=<td><code><a href="#SUBTOK-wc">wc</a>*</code>
388398
<tr><td id="SUBTOK-wc">wc <td>::=<td><code>#x9 | #xA | #xC | #xD | #x20</code>
389399
</table>
@@ -573,26 +583,20 @@ <h3 id="keywords">Keywords</h3>
573583
<pre>
574584
width: "auto";
575585
border: "none";
576-
font-family: "serif";
577586
background: "red";
578587
</pre>
579588
</div>
580589

581590

582591
<h3>Statements</h3>
583592

584-
<p> A CSS style sheet, for any version of CSS, consists of a list of
593+
<p>A CSS style sheet, for any version of CSS, consists of a list of
585594
<span class="index-inst" title="statements"><em>statements</em></span>
586595
(see the grammar above). There are two kinds of statements: <span
587596
class="index-inst" title="at-rules"><em>at-rules</em></span>
588597
and <span class="index-inst" title="rule sets"><em>rule
589598
sets.</em></span> There may be <a href="#whitespace">whitespace</a>
590-
around the statements.
591-
592-
<p>In this specification, the expressions "immediately before" or
593-
"immediately after" mean with no intervening whitespace or comments.
594-
595-
<!-- Should comments be defined as whitespace? -->
599+
around the statements.</p>
596600

597601
<h3 id="at-rules" class="index-def" title="at-rules">At-rules</h3>
598602

@@ -603,14 +607,10 @@ <h3 id="at-rules" class="index-def" title="at-rules">At-rules</h3>
603607

604608
<p> An at-rule consists of everything up to and including the next
605609
semicolon (;) or the next <a href="#block">block,</a> whichever comes
606-
first. A CSS user agent that encounters an unrecognized at-rule must
607-
<span class="index-inst" title="ignore"><a href="#ignore">ignore</a></span>
608-
the whole of the at-rule and continue parsing after it.
609-
610-
<p>CSS3 user agents must <span class="index-inst" title="ignore"><a
611-
href="#ignore">ignore</a></span> any <a
612-
href="#at-import">'@import'</a> rule that occurs inside a <a
613-
href="#block">block</a> or that doesn't precede all rule sets.
610+
first. A CSS user agent that encounters an unrecognized or misplaced
611+
at-rule must <span class="index-inst" title="ignore"><a
612+
href="#ignore">ignore</a></span> the whole of the at-rule and continue
613+
parsing after it.</p>
614614

615615
<div class="illegal-example"><p>
616616
Assume, for example, that a CSS3 parser encounters this style sheet:
@@ -621,7 +621,9 @@ <h3 id="at-rules" class="index-def" title="at-rules">At-rules</h3>
621621
@import "list.css";
622622
</PRE>
623623

624-
<p> The second '@import' is illegal according to CSS3. The CSS3 parser
624+
<p>The second '<code>@import</code>' is illegal according to CSS3 since
625+
'<code>@import</code>' rules must occur before all rules other than
626+
'<code>@charset</code>' rules. The CSS3 parser
625627
<span class="index-inst" title="ignore"><a href="#ignore">ignores</a></span>
626628
the whole at-rule, effectively reducing the style sheet to:
627629

@@ -1222,10 +1224,11 @@ <h3 id="at-import">Style sheets including other style sheets:
12221224

12231225
<p>The <span class="index-def"
12241226
title="@import"><dfn>'@import'</dfn></span> rule allows users to
1225-
import style rules from other style sheets. Any @import rules must
1226-
precede all rule sets in a style sheet. The '@import' keyword must be
1227-
followed by the URI of the style sheet to include. A string is also
1228-
allowed; it will be interpreted as if it had url(...) around it.</p>
1227+
import style rules from other style sheets. Any @import rules must
1228+
follow all @charset rules and precede all other at-rules and rule sets
1229+
in a style sheet. The '@import' keyword must be followed by the URI of
1230+
the style sheet to include. A string is also allowed; it will be
1231+
interpreted as if it had url(...) around it.</p>
12291232

12301233
<div class="example"><p>
12311234
The following lines are equivalent in meaning and illustrate both
@@ -1269,9 +1272,9 @@ <h2>Defining namespaces: the <code>@namespace</code> rule</h2>
12691272
for example the Selectors Module [[!SELECT]] or the Generated Content
12701273
module [[CSS3GENCON]].
12711274
Any @namespace rules
1272-
must follow all @import and @charset rules and precede all other rule sets
1273-
in a style sheet. This is to avoid any confusion or issues regarding the
1274-
scope of the declared namespace.
1275+
must follow all @import and @charset rules and precede all other
1276+
at-rules and rule sets in a style sheet. This is to avoid any confusion
1277+
or issues regarding the scope of the declared namespace.
12751278
</p>
12761279

12771280
<p>If the optional namespace prefix is omitted, then the namespace URI

0 commit comments

Comments
 (0)