11<!DOCTYPE HTML SYSTEM "http://www.w3.org/TR/WD-html40/sgml/HTML4.dtd">
22<html lang="en">
3- <!-- $Id: conform.src,v 1.4 1997-08-11 23:53:15 ian Exp $ -->
3+ <!-- $Id: conform.src,v 1.5 1997-08-12 20:10:24 ian Exp $ -->
44<HEAD>
55<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66<TITLE>CSS2 Conformance</TITLE>
@@ -203,20 +203,36 @@ opening quote:
203203</PRE>
204204</div>
205205
206- <H3>Rule sets</H3>
206+ <H3>Rule sets, declaration blocks, and selector-strings </H3>
207207
208- <P> A rule set consists of a <span class="index-inst" title="selector
209- string"><em>selector string</em></span> followed by a <span
210- class="index-inst" title="declaration block"><em>declaration
211- block</em></span>. The selector-string consists of everything up to
212- (but not including) the first left curly brace ({). A ruleset that
213- starts with a selector-string that is not valid CSS2 is skipped.
208+ <P> A rule set consists of a selector-string followed by a
209+ declaration block.
210+
211+ <P> A <span class="index-def"
212+ title="declaration-block"><em>declaration-block</em></span> (also
213+ called a {}-block in the following text) starts with a left curly
214+ brace ({) and ends with the matching right curly brace (}). In between
215+ there is a list of zero or more <DFN>declarations,</DFN> separated by
216+ semicolons (;).
217+
218+ <P>The <span class="index-def"
219+ title="selector-string"><em>selector-string</em></span> consists of
220+ everything up to (but not including) the first left curly brace ({).
221+ A selector-string does not start with an "@", does not include a "{",
222+ that always goes together with a {}-block. When a UA can't parse the
223+ selector-string (i.e., it is not valid CSS2), it should skip the
224+ {}-block as well.
225+
226+ <P>Implementations may want to collect the uninterpreted string of
227+ characters up to but not including the first "{" to find the
228+ declaration, and then attempt to lexically analyze the selector
229+ string.
214230
215231<div class="example"><P>
216232For example, assume a CSS2 parser encounters this style sheet:
217233<PRE>
218234 H1 { color: blue }
219- P[align], UL { color: red; font-size: large }
235+ P[align], UL { color: red; font-size: large } /* ILLEGAL */
220236 P EM { font-weight: bold }
221237</PRE>
222238
@@ -227,10 +243,33 @@ CSS2. The CSS2 UA will skip the ruleset, reducing the style sheet to:
227243 H1 { color: blue }
228244 P EM { font-weight: bold }
229245</PRE>
246+ </div>
247+
248+ <div class="example"><P>
249+ <P>Similary, the following rule:
250+
251+ <PRE>
252+ P[align & justify
253+ { color: red; font-size: large }
254+ </PRE>
255+
256+ <P>would be parsed without problem while:
257+
258+ <PRE>
259+ P[example="public class foo
260+ {
261+ private int x;
262+
263+ foo(int x) {
264+ this.x = x;
265+ }
266+
267+ }"] /* ILLEGAL since {}-block missing */
268+ </PRE>
269+ <!-- " -->
270+ <P>would not since it is not followed by a {}-block.
271+ </div>
230272
231- <P> A declaration-block starts with a left curly brace ({) and ends
232- with the matching right curly brace (}). In between there is a list of
233- zero or more <DFN>declarations,</DFN> separated by semicolons (;).
234273
235274<H3>Properties</H3>
236275
0 commit comments