Skip to content

Commit b36e914

Browse files
committed
[dbaron revision history] Merge in some CSS 2.1 syndata.html changes. Use lowercase tags in examples, and better examples of font-size and line-height. (date: 2003/08/07 21:15:58)
1 parent 1859a8f commit b36e914

1 file changed

Lines changed: 63 additions & 42 deletions

File tree

css3-syntax/Overview.src.html

Lines changed: 63 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ <h3>Referring to characters not represented in a character encoding</h3>
254254
For example, we recommend:</em></p>
255255

256256
<pre class="html-example">
257-
&lt;SPAN style="voice-family: D\FC rst"&gt;...&lt;/SPAN&gt;
257+
&lt;span style="voice-family: D\FC rst"&gt;...&lt;/span&gt;
258258
</pre>
259259

260260
<p><em>rather than:</em></p>
261261

262262
<pre class="html-example">
263-
&lt;SPAN style="voice-family: D&amp;#252;rst"&gt;...&lt;/SPAN&gt;
263+
&lt;span style="voice-family: D&amp;#252;rst"&gt;...&lt;/span&gt;
264264
</pre>
265265
</div>
266266

@@ -619,7 +619,7 @@ <h3 id="at-rules" class="index-def" title="at-rules">At-rules</h3>
619619

620620
<PRE>
621621
@import "subs.css";
622-
H1 { color: blue }
622+
h1 { color: blue }
623623
@import "list.css";
624624
</PRE>
625625

@@ -631,7 +631,7 @@ <h3 id="at-rules" class="index-def" title="at-rules">At-rules</h3>
631631

632632
<PRE>
633633
@import "subs.css";
634-
H1 { color: blue }
634+
h1 { color: blue }
635635
</PRE>
636636
</div>
637637

@@ -645,7 +645,7 @@ <h3 id="at-rules" class="index-def" title="at-rules">At-rules</h3>
645645
@import "print-main.css";
646646
BODY { font-size: 10pt }
647647
}
648-
H1 {color: blue }
648+
h1 {color: blue }
649649
</PRE>
650650
</div>
651651

@@ -711,9 +711,9 @@ <h3>Rule sets, declaration blocks, and selectors</h3>
711711
<span class="index-inst" title="ignore"><a href="#ignore">ignore</a></span>
712712
the whole second line, and not set the color of H3 to red:
713713
<PRE>
714-
H1, H2 {color: green }
715-
H3, H4 &amp; H5 {color: red }
716-
H6 {color: black }
714+
h1, h2 {color: green }
715+
h3, h4 &amp; h5 {color: red }
716+
h6 {color: black }
717717
</PRE>
718718
</DIV>
719719

@@ -722,7 +722,7 @@ <h3>Rule sets, declaration blocks, and selectors</h3>
722722
are inside a string, and do not mark the end of the selector. This is
723723
a valid CSS3 statement.
724724
<PRE>
725-
P[example="public class foo\
725+
p[example="public class foo\
726726
{\
727727
private int x;\
728728
\
@@ -758,22 +758,22 @@ <h3 id="declaration">Declarations and properties</h3>
758758
<div class="example"><p>
759759
Thus, the following rules:</p>
760760
<pre>
761-
H1 { font-weight: bold }
762-
H1 { font-size: 12pt }
763-
H1 { line-height: 14pt }
764-
H1 { font-family: Helvetica }
765-
H1 { font-variant: normal }
766-
H1 { font-style: normal }
761+
h1 { font-weight: bold }
762+
h1 { font-size: 2em }
763+
h1 { line-height: 1.2 }
764+
h1 { font-family: Helvetica, Arial, sans-serif }
765+
h1 { font-variant: normal }
766+
h1 { font-style: normal }
767767
</pre>
768768

769769
<p>are equivalent to:</p>
770770

771771
<pre>
772-
H1 {
772+
h1 {
773773
font-weight: bold;
774-
font-size: 12pt;
775-
line-height: 14pt;
776-
font-family: Helvetica;
774+
font-size: 2em;
775+
line-height: 1.2;
776+
font-family: Helvetica, Arial, sans-serif;
777777
font-variant: normal;
778778
font-style: normal
779779
}
@@ -804,10 +804,10 @@ <h3 id="declaration">Declarations and properties</h3>
804804
For example, assume a CSS3 parser encounters this style sheet:
805805

806806
<PRE>
807-
H1 { color: red; font-style: 12pt } /* Invalid value: 12pt */
808-
P { color: blue; font-vendor: any; /* Invalid prop.: font-vendor */
807+
h1 { color: red; font-style: 12px } /* Invalid value: 12px */
808+
p { color: blue; font-vendor: any; /* Invalid prop.: font-vendor */
809809
font-variant: small-caps }
810-
EM EM { font-style: normal }
810+
em em { font-style: normal }
811811
</PRE>
812812

813813
<p> The second declaration on the first line has an invalid value
@@ -817,9 +817,9 @@ <h3 id="declaration">Declarations and properties</h3>
817817
declarations, effectively reducing the style sheet to:
818818

819819
<PRE class="example">
820-
H1 { color: red; }
821-
P { color: blue; font-variant: small-caps }
822-
EM EM { font-style: normal }
820+
h1 { color: red; }
821+
p { color: blue; font-variant: small-caps }
822+
em em { font-style: normal }
823823
</PRE>
824824
</div>
825825

@@ -867,7 +867,7 @@ <h2 id="error-handling">Rules for handling parsing errors or unsupported feature
867867
property. For example, if the style sheet is:
868868

869869
<PRE class="illegal-example">
870-
H1 { color: red; rotation: 70minutes }
870+
h1 { color: red; rotation: 70minutes }
871871
</PRE>
872872

873873
<p> the user agent will treat this as if the style sheet had been
@@ -880,21 +880,21 @@ <h2 id="error-handling">Rules for handling parsing errors or unsupported feature
880880
declaration with an illegal value. For example:
881881

882882
<PRE class="illegal-example">
883-
IMG { float: left } /* correct CSS3 */
884-
IMG { float: left here } /* "here" is not a value of 'float' */
885-
IMG { background: "red" } /* keywords cannot be quoted in CSS3 */
886-
IMG { border-width: 3 } /* a unit must be specified for length values */
883+
img { float: left } /* correct CSS3 */
884+
img { float: left here } /* "here" is not a value of 'float' */
885+
img { background: "red" } /* keywords cannot be quoted in CSS3 */
886+
img { border-width: 3 } /* a unit must be specified for length values */
887887
</PRE>
888888

889889
A CSS3 parser would honor the first rule and
890890
<span class="index-inst" title="ignore"><a href="#ignore">ignore</a></span>
891891
the rest, as if the style sheet had been:
892892

893893
<PRE class="example">
894-
IMG { float: left }
895-
IMG { }
896-
IMG { }
897-
IMG { }
894+
img { float: left }
895+
img { }
896+
img { }
897+
img { }
898898
</PRE>
899899

900900
<p>A user agent conforming to a future CSS specification may accept one or
@@ -904,6 +904,27 @@ <h2 id="error-handling">Rules for handling parsing errors or unsupported feature
904904
when disallowed might be useful. It should probably be a parsing error.
905905
We might want to add additional grammar productions for potentially
906906
negative numbers.]</p>
907+
</li>
908+
909+
<li><strong>Malformed declarations.</strong> User agents must handle
910+
unexpected tokens encountered while parsing a declaration by reading
911+
until the end of the declaration, while observing the rules for matching
912+
pairs of (), [], {}, "", and '', and correctly handling escapes. For
913+
example, a malformed declaration may be missing a property, colon (:) or
914+
value. The following are all equivalent:
915+
916+
<pre class="example"><code>
917+
p { color:green }
918+
p { color:green; color } /* malformed declaration missing ':', value */
919+
p { color:red; color; color:green } /* same with expected recovery */
920+
p { color:green; color: } /* malformed declaration missing value */
921+
p { color:red; color:; color:green } /* same with expected recovery */
922+
p { color:green; color{;color:maroon} } /* unexpected tokens { } */
923+
p { color:red; color{;color:maroon}; color:green } /* same with recovery */
924+
</code></pre>
925+
926+
</li>
927+
907928

908929
<LI><strong>Invalid at-keywords.</strong> User agents must <span
909930
class="index-inst" title="ignore"><a href="#ignore">ignore</a></span> an
@@ -917,9 +938,9 @@ <h2 id="error-handling">Rules for handling parsing errors or unsupported feature
917938
azimuth: 30deg;
918939
elevation: 190deg;
919940
}
920-
H1 { color: red }
941+
h1 { color: red }
921942
}
922-
H1 { color: blue }
943+
h1 { color: blue }
923944
</PRE>
924945

925946
<p> The '@three-dee' at-rule is not part of CSS3. Therefore, the whole
@@ -930,7 +951,7 @@ <h2 id="error-handling">Rules for handling parsing errors or unsupported feature
930951
to:</p>
931952

932953
<PRE class="example">
933-
H1 { color: blue }
954+
h1 { color: blue }
934955
</PRE>
935956

936957
</UL>
@@ -1959,11 +1980,11 @@ <h3>Shorthand properties</h3>
19591980
The multiple style rules of this example:</p>
19601981

19611982
<pre>
1962-
H1 {
1983+
h1 {
19631984
font-weight: bold;
1964-
font-size: 12pt;
1965-
line-height: 14pt;
1966-
font-family: Helvetica;
1985+
font-size: 2em;
1986+
line-height: 1.2;
1987+
font-family: Helvetica, Arial, sans-serif;
19671988
font-variant: normal;
19681989
font-style: normal;
19691990
font-stretch: normal;
@@ -1974,7 +1995,7 @@ <h3>Shorthand properties</h3>
19741995
<p>may be rewritten with a single shorthand property:</p>
19751996

19761997
<pre>
1977-
H1 { font: bold 12pt/14pt Helvetica }
1998+
h1 { font: bold 2em/1.2 Helvetica, Arial, sans-serif }
19781999
</pre>
19792000

19802001
<p>In this example, <span

0 commit comments

Comments
 (0)