Skip to content

Commit a9081c7

Browse files
committed
[css2] Fixed links again. Integrated Hakon's changes. Added print. Added ACSS
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%4033
1 parent 5447aa0 commit a9081c7

19 files changed

Lines changed: 2206 additions & 532 deletions

css2/Attic/conform.src

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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>
216232
For 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

css2/DOC/CONVENTIONS

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ Properties
4545

4646
* To mark up property instances:
4747

48-
<span id="propinst-propname" class="propinst">'propname'</span>
48+
<span class="propinst-propname">'propname'</span>
49+
50+
(Can't use id since there are several instances)
51+
52+
This will generate:
53+
54+
<a href="..." class="propinst"><span class="propinst-propname">'propname'</span></a>
4955

5056
- Property instances will link to the definitions.
5157

@@ -78,11 +84,16 @@ Note that the name attribute is first.
7884
MarkUp all value instances with:
7985

8086
<span class="index-inst" title="value">
81-
<span id="value-inst-value" class="value-inst">value</span>
87+
<span class="value-inst-value">value</span>
8288
</span>
8389

8490
The "value" in the text may be marked up (e.g., &lt;value&gt;)
8591

92+
This will generate the same thing with an A element around the inner
93+
span:
94+
95+
<a href="..." class="value-inst"><span class="value-inst-value">value</span></a>
96+
8697
************
8798
Indexes
8899
************
@@ -181,7 +192,7 @@ Document HEAD
181192

182193
<!DOCTYPE HTML SYSTEM "http://www.w3.org/TR/WD-html40/sgml/HTML4.dtd">
183194
<html lang="en">
184-
<!-- $Id: CONVENTIONS,v 1.7 1997-08-12 00:11:28 ian Exp $ -->
195+
<!-- $Id: CONVENTIONS,v 1.8 1997-08-12 20:35:49 ian Exp $ -->
185196
<HEAD>
186197
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
187198
<TITLE>CSS2 Specification</TITLE>

css2/bin/Attic/addlinks

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Add links from instances to definitions
33
#
44
# Arnaud Le Hors - lehors@w3.org
5-
# $Id: addlinks,v 1.2 1997-08-12 00:13:08 ian Exp $
5+
# $Id: addlinks,v 1.3 1997-08-12 20:37:23 ian Exp $
66

77
if (($_ = $ARGV[0], /^-r/) && $ARGV[0]) {
88
shift;
@@ -63,11 +63,11 @@ sub readfile {
6363
# given the regexp either both elem1 and elem2 are empty strings
6464
# or one or the other is, but in no case both are non empty
6565
# so we can concatenate them both together
66-
# args: start_tag key contents end_tag
66+
# args: start_tag key contents end_tag class
6767
sub addlink {
6868
if (($link = $adbase{lc("$_[1]")})) {
6969
$rlink = rpath($realpath, $link);
70-
return "<a href=\"$rlink\">$_[0]$_[2]$_[3]</a>";
70+
return "<a href=\"$rlink\" class=\"$_[4]\">$_[0]$_[2]$_[3]</a>";
7171
} else { # no anchor found, leave it unchanged
7272
return "$_[0]$_[2]$_[3]";
7373
}
@@ -100,8 +100,8 @@ while ($class = $ARGV[0]) {
100100
readadb($ARGV[0]);
101101
shift;
102102
# insert appropriate links
103-
$stag="<span[ \t\n]*id=$class-($wd)[^ \t\n\]*[^>]*>|<span[ \t\n]*id=\"$class-($wd)\"[^ \t\n\]*[^>]*>";
104-
$buf =~ s/($stag)(.*?)($etag)/addlink($1, "$2$3", $4, $5)/sgie;
103+
$stag="<span[ \t\n]*class=$class-($wd)>|<span[ \t\n]*class=\"$class-($wd)\">";
104+
$buf =~ s/($stag)(.*?)($etag)/addlink($1, "$2$3", $4, $5, $class)/sgie;
105105
}
106106

107107
# print out result

css2/bin/addlinks

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Add links from instances to definitions
33
#
44
# Arnaud Le Hors - lehors@w3.org
5-
# $Id: addlinks,v 1.2 1997-08-12 00:13:08 ian Exp $
5+
# $Id: addlinks,v 1.3 1997-08-12 20:37:23 ian Exp $
66

77
if (($_ = $ARGV[0], /^-r/) && $ARGV[0]) {
88
shift;
@@ -63,11 +63,11 @@ sub readfile {
6363
# given the regexp either both elem1 and elem2 are empty strings
6464
# or one or the other is, but in no case both are non empty
6565
# so we can concatenate them both together
66-
# args: start_tag key contents end_tag
66+
# args: start_tag key contents end_tag class
6767
sub addlink {
6868
if (($link = $adbase{lc("$_[1]")})) {
6969
$rlink = rpath($realpath, $link);
70-
return "<a href=\"$rlink\">$_[0]$_[2]$_[3]</a>";
70+
return "<a href=\"$rlink\" class=\"$_[4]\">$_[0]$_[2]$_[3]</a>";
7171
} else { # no anchor found, leave it unchanged
7272
return "$_[0]$_[2]$_[3]";
7373
}
@@ -100,8 +100,8 @@ while ($class = $ARGV[0]) {
100100
readadb($ARGV[0]);
101101
shift;
102102
# insert appropriate links
103-
$stag="<span[ \t\n]*id=$class-($wd)[^ \t\n\]*[^>]*>|<span[ \t\n]*id=\"$class-($wd)\"[^ \t\n\]*[^>]*>";
104-
$buf =~ s/($stag)(.*?)($etag)/addlink($1, "$2$3", $4, $5)/sgie;
103+
$stag="<span[ \t\n]*class=$class-($wd)>|<span[ \t\n]*class=\"$class-($wd)\">";
104+
$buf =~ s/($stag)(.*?)($etag)/addlink($1, "$2$3", $4, $5, $class)/sgie;
105105
}
106106

107107
# print out result

css2/cascade.src

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML SYSTEM "http://www.w3.org/TR/WD-html40/sgml/HTML4.dtd">
22
<html lang="en">
3-
<!-- $Id: cascade.src,v 1.6 1997-08-11 23:50:53 ian Exp $ -->
3+
<!-- $Id: cascade.src,v 1.7 1997-08-12 20:06:46 ian Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Cascade</TITLE>
@@ -122,10 +122,12 @@ sheet, e.g., through a pull-down menu.
122122
declarations by declaring them <span class="index-def"
123123
title="'important'">'important'</span>.
124124

125+
<div class="example"><P>
125126
<PRE>
126127
H1 { color: black ! important; background: white ! important }
127-
P { font-size: 12pt ! important; font-style: italic }
128+
P { font-size: 12pt ! important; font-variant: italic }
128129
</PRE>
130+
</div>
129131

130132
<P> In the example above, the first three declarations have increased
131133
weight, while the last declaration has normal weight.
@@ -145,7 +147,10 @@ In HTML, a selector's specificity is calculated as follows:
145147
<ul>
146148

147149
<P>Concatenating the three numbers (in a number system with a large
148-
base) gives the specificity. Some examples:
150+
base) gives the specificity.
151+
152+
<div class="example"><P>
153+
Some examples:
149154

150155
<PRE>
151156
LI {...} /* a=0 b=0 c=1 -&gt; specificity = 1 */
@@ -155,12 +160,14 @@ base) gives the specificity. Some examples:
155160
UL OL LI.red {...} /* a=0 b=1 c=3 -&gt; specificity = 13 */
156161
#x34y {...} /* a=1 b=0 c=0 -&gt; specificity = 100 */
157162
</PRE>
163+
</div>
158164

159165

160166
<P> A declaration in the "style" attribute of an element has the same
161167
weight as a declaration with an "id"-based selector that is specified
162168
at the end of the style sheet:
163169

170+
<div class="example"><P>
164171
<PRE>
165172
&lt;STYLE type="text/css"&gt;
166173
#x97z { color: blue }
@@ -173,6 +180,7 @@ at the end of the style sheet:
173180
red. Although the specificity is the same for both declarations, the
174181
declaration in the "style" attribute will override the one in the
175182
STYLE element because of cascading rule number 5.
183+
</div>
176184

177185
<H4>HTML presentational attributes and CSS</H4>
178186
<P> The UA may choose to honor other stylistic HTML attributes, for

0 commit comments

Comments
 (0)