Skip to content

Commit 9e2001c

Browse files
committed
[css2] Tantek's edits: Added DELIM in front of decalration. Added text about
recovering from malformed declarations. --HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402075
1 parent 94372ae commit 9e2001c

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

css2/syndata.src

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
22
"http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
33
<html lang="en">
4-
<!-- $Id: syndata.src,v 2.80 2003-01-27 21:38:56 bbos Exp $ -->
4+
<!-- $Id: syndata.src,v 2.81 2003-03-21 16:04:22 bbos Exp $ -->
55
<head>
66
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
77
<title>Syntax and basic data types</title>
8-
<!-- Changed by: Tantek Celik, 2002-12-16 -->
8+
<!-- Changed by: Tantek Celik, 2003-03-03 -->
99
<style type="text/css">
1010
span.colorsquare { float:left; width:5em; height:3em; text-align:center; padding:1.2em 0 .8em }
1111
span.colorname { font-weight:bold }
@@ -113,8 +113,8 @@ at-rule : ATKEYWORD S* any* [ block | ';' S* ];
113113
block : '{' S* [ any | block | ATKEYWORD S* | ';' ]* '}' S*;
114114
ruleset : selector? '{' S* declaration? [ ';' S* declaration? ]* '}' S*;
115115
selector : any+;
116-
declaration : property ':' S* value;
117-
property : IDENT S*;
116+
declaration : DELIM? property S* ':' S* value;
117+
property : IDENT;
118118
value : [ any | block | ATKEYWORD S* ]+;
119119
any : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
120120
| DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
@@ -538,6 +538,22 @@ img { }
538538
<p>A user agent conforming to a future CSS specification may accept one or
539539
more of the other rules as well.</p>
540540

541+
<li><strong>Malformed declarations.</strong> User agents must handle unexpected tokens encountered while parsing a declaration by reading until the end of the declaration, while observing the rules for matching pairs of (), [], {}, "", and '', and correctly handling escapes. For example, a malformed declaration may be missing a property, colon (:) or value. The following are all equivalent:
542+
543+
544+
<pre class="example"><code>
545+
p { color:green }
546+
p { color:green; color } /* malformed declaration missing ':', value */
547+
p { color:red; color; color:green } /* same with expected recovery */
548+
p { color:green; color: } /* malformed declaration missing value */
549+
p { color:red; color:; color:green } /* same with expected recovery */
550+
p { color:green; color{;color:maroon} } /* unexpected tokens { } */
551+
p { color:red; color{;color:maroon}; color:green } /* same with recovery */
552+
</code></pre>
553+
554+
</li>
555+
556+
541557
<li><strong>Invalid at-keywords.</strong> User agents must <span
542558
class="index-inst" title="ignore"><a href="#ignore">ignore</a></span> an
543559
invalid at-keyword together with everything following it, up to and
@@ -1056,7 +1072,6 @@ a[title="a not so very long title"] {/*...*/}
10561072
</pre>
10571073
</div>
10581074

1059-
<ins class="proposed">
10601075
<h3 id="unsupportedvalues">Unsupported Values</h3>
10611076

10621077
<p>If a UA does not support a particular value, it should <em>ignore</em> that
@@ -1078,7 +1093,7 @@ the second display declaration. A UA that does not support the 'run-in'
10781093
value will process the first display declaration and ignore the second
10791094
display declaration.
10801095
</p>
1081-
</ins>
1096+
10821097

10831098
<h2>CSS document representation</h2>
10841099

0 commit comments

Comments
 (0)