Skip to content

Commit b07cea9

Browse files
committed
[css2] Added "computed values" line to all property defintions.
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401965
1 parent c210ad8 commit b07cea9

7 files changed

Lines changed: 963 additions & 347 deletions

File tree

css2/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile to generate the CSS2 document based on its "source files"
22
# Arnaud Le Hors - lehors@w3.org
3-
# $Id: Makefile,v 2.62 2002-08-21 11:43:32 bbos Exp $
3+
# $Id: Makefile,v 2.63 2002-11-18 20:36:16 bbos Exp $
44

55
# what needs to be set for every new release:
66
# Note use of full year (1998) in identifier.
@@ -356,8 +356,9 @@ build/blocks.ok: $(PROPBLKSDIR)/blocks.ok
356356
touch $@
357357

358358
$(PROPBLKSDIR)/blocks.ok: $(PROPSRC)
359-
@if [ ! -d $(PROPBLKSDIR) ]; then mkdir -p $(PROPBLKSDIR);fi
360-
$(PEXTR) -l 2.1 $(PROPSRC) $(PROPBLKSDIR)
359+
@rm -rf $(PROPBLKSDIR)
360+
@mkdir -p $(PROPBLKSDIR)
361+
$(PEXTR) $(PROPSRC) $(PROPBLKSDIR)
361362
touch $@
362363

363364

@@ -405,7 +406,7 @@ indexlist.html: indexlist.srd build/indexlist.srb Project.cfg
405406

406407
build/propidx.srb: $(PROPSRC)
407408
@echo "=========== making" $@
408-
$(MKPROPIDX) -l 2.1 -r $@ $@ $(PROPSRC)
409+
$(MKPROPIDX) -r $@ $@ $(PROPSRC)
409410

410411
propidx.srd:: build/propidx.srb #propidx.src
411412
# @echo "=========== making" $@

css2/about.src

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'http://www.w3.org/TR/html4/strict.dtd'>
33

44
<html lang="en">
5-
<!-- $Id: about.src,v 2.41 2002-08-07 12:52:59 bbos Exp $ -->
5+
<!-- $Id: about.src,v 2.42 2002-11-18 20:36:16 bbos Exp $ -->
66
<HEAD>
77
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
88
<TITLE>About the CSS&nbsp;2.1 Specification</TITLE>
@@ -254,10 +254,24 @@ property does not accept percentages as values.
254254
groups</a> to which the property applies. Information about media
255255
groups is non-normative.
256256

257+
<h4>Computed value</h4>
258+
259+
<p>This part describes the <a href='[ref to 6.1.2]'>computed
260+
value</a> for the property. The computed value is used by <a
261+
href='[ref to 6.2]'>inheritance</a> and may be referred to by
262+
other specifications.
263+
264+
The computed value exists even when the property doesn't apply, as
265+
defined by the <a href='[neighboring subsection]'>Applies To</a>
266+
line. However, some properties may define the computed value of a
267+
property for an element to depend on whether the property applies
268+
to that element.
269+
270+
257271
<H3><a name="shorthand">Shorthand properties</a></H3>
258272

259273
<p>Some properties are <span class="index-def" title="shorthand
260-
property"><dfn>shorthand properties</dfn></span>, meaning they allow
274+
property"><dfn>shorthand properties</dfn></span>, meaning that they allow
261275
authors to specify the values of several properties with a single
262276
property.
263277

css2/bin/mkpropidx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/local/bin/perl
22
# Index of property names.
33
# Arnaud Le Hors lehors@w3.org/Ian Jacobs ij@w3.org
4-
# $Id: mkpropidx,v 2.8 2002-08-21 11:44:43 bbos Exp $
4+
# $Id: mkpropidx,v 2.9 2002-11-18 20:36:16 bbos Exp $
55
use English;
66

77

@@ -11,19 +11,16 @@ while ($ARGV[0] =~ /^-/) {
1111
if ($ARGV[0] eq "-r" && $ARGV[1]) {
1212
shift;
1313
$realpath = shift;
14-
} elsif ($ARGV[0] eq "-l" && $ARGV[1]) {
15-
shift;
16-
$level = shift;
1714
} else {
18-
print "Usage: $PROGNAME [-r realpath] [-l level] indexfile dbase\n";
15+
print "Usage: $PROGNAME [-r realpath] indexfile dbase\n";
1916
exit 1;
2017
}
2118
}
2219

2320
$PROGNAME = substr($0, rindex($0, "/") + 1);
2421

2522
if (!$ARGV[1]) {
26-
print "Usage: $PROGNAME [-r realpath] [-l level] indexfile dbase\n";
23+
print "Usage: $PROGNAME [-r realpath] indexfile dbase\n";
2724
exit 1;
2825
} else {
2926
$indexf = $ARGV[0];
@@ -146,6 +143,11 @@ sub format_media {
146143
print OUTPUT "<td>$fmedia\n";
147144
}
148145

146+
sub format_compval {
147+
$compval = cleanup($_[0]);
148+
print OUTPUT "<td>$compval\n";
149+
}
150+
149151
sub table_head {
150152
print OUTPUT "<table border=1 align=center>\n";
151153
print OUTPUT "<thead>";
@@ -164,19 +166,18 @@ sub table_head {
164166

165167
sub table_body {
166168
foreach $x (sort @indexes) {
167-
($name, $val, $init, $app, $inh, $perc, $media, $csslevels) = split(/;;/, $x);
168-
if (! defined $level || $csslevels =~ /\b$level\b/) {
169-
print OUTPUT "<tr>";
170-
format_name($name);
171-
format_val($val);
172-
format_init($init);
173-
format_app($app);
174-
format_inh($inh);
175-
format_perc($perc);
176-
format_media($media);
177-
print OUTPUT "\n";
178-
}
179-
}
169+
($name, $val, $init, $app, $inh, $perc, $media, $compval) = split(/;;/, $x);
170+
print OUTPUT "<tr>";
171+
format_name($name);
172+
format_val($val);
173+
format_init($init);
174+
format_app($app);
175+
format_inh($inh);
176+
format_perc($perc);
177+
format_media($media);
178+
format_compval($compval);
179+
print OUTPUT "\n";
180+
}
180181
}
181182

182183
sub table_foot {

css2/bin/pextr

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Extract entries from the CSS properties database
33
# The database has the following format:
44
# name;; values;; initial-value;; applies-to;;
5-
# inherited;; percentages;; media;; CSS-level
5+
# inherited;; percentages;; media;; computed value
66
# Special characters:
77
# 1) Translate "*" into the words "all elements"
88
# 1.a) Translate "XX" into "not defined for shorthand properties"
@@ -13,27 +13,16 @@
1313
# <span class="propinst-name">&lt;'name'&gt;</span>
1414
#
1515
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
16-
# $Id: pextr,v 1.22 2002-08-21 12:45:29 bbos Exp $
16+
# $Id: pextr,v 1.23 2002-11-18 20:36:16 bbos Exp $
1717
#
1818

1919
$PROGNAME = substr($0, rindex($0, "/") + 1);
2020

2121
if (!$ARGV[0]) {
22-
print "Usage: $PROGNAME [-l level] file [tgt_dir]\n";
22+
print "Usage: $PROGNAME file [tgt_dir]\n";
2323
exit 1;
2424
}
2525

26-
$level = "2";
27-
28-
while ($ARGV[0] =~ /^-/) {
29-
if ($ARGV[0] eq "-l" && $ARGV[1]) {
30-
shift;
31-
$level = shift;
32-
} else {
33-
print "Usage: $PROGNAME [-l level] file tgt_dir]\n";
34-
}
35-
}
36-
3726
# copy file in memory
3827
if (!open(input, $ARGV[0])) {
3928
print "$PROGNAME Error: Cannot open file: $ARGV[0]\n";
@@ -64,6 +53,7 @@ my $applies = $_[3];
6453
my $inherited = $_[4];
6554
my $percentages = $_[5];
6655
my $media = $_[6];
56+
my $compval = $_[7];
6757
#Do next three lines in src files to get headings right.
6858
print output "<div class=\"propdef\">\n";
6959
print output "<dl><dt>\n";
@@ -84,6 +74,7 @@ print output "<table class=\"propinfo\" cellspacing=0 cellpadding=0>\n";
8474
&format_inherited($inherited);
8575
&format_percentages($percentages);
8676
&format_media($media);
77+
&format_compval($compval);
8778
print output "</table>\n";
8879
print output "</dl>\n";
8980
print output "</div>\n\n";
@@ -155,29 +146,38 @@ sub format_media {
155146
print output "<td>$fmedia\n";
156147
}
157148

149+
sub format_compval {
150+
print output "<tr valign=baseline>";
151+
print output "<td><em>Computed value:</em>&nbsp;&nbsp;";
152+
print output "<td>$_[0]\n";
153+
}
154+
158155

159156
# extract every possible block
160157
$_ = $buf;
161-
while (/$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
158+
while (/$blockst(?:.*?)$blocket/s) {
159+
$placeholder = $';
160+
my $h = $&;
161+
if ($h =~ /$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
162162
# Set parameters first (before any modifications)
163-
$placeholder = $';
164163
my $props = $1;
165164
my $values = $2;
166165
my $init = $3;
167166
my $applies = $4;
168167
my $inherited = $5;
169168
my $percentage = $6;
170169
my $media = $7;
171-
my $lvl = $8;
170+
my $compval = $8;
172171
my @names = split(/[, \t\n]+/, $props);
173172
my $name = $names[0];
174-
if ($lvl =~ /\b$level\b/) {
175-
$output = "$path$name.srb";
176-
print "\textracting $output\n";
177-
open(output, "> $output");
178-
&format_property($props, $values, $init, $applies, $inherited,
179-
$percentage, $media);
180-
close(output);
181-
}
182-
$_ = $placeholder;
173+
$output = "$path$name.srb";
174+
print "\textracting $output\n";
175+
open(output, "> $output");
176+
&format_property($props, $values, $init, $applies, $inherited,
177+
$percentage, $media, $compval);
178+
close(output);
179+
} else {
180+
warn "Incorrect syntax for property definition: $h\n";
181+
}
182+
$_ = $placeholder;
183183
}

css2/box.src

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html lang="en">
3-
<!-- $Id: box.src,v 1.27 2002-09-13 23:40:54 bbos Exp $ -->
3+
<!-- $Id: box.src,v 1.28 2002-11-18 20:36:16 bbos Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Box model</TITLE>
@@ -62,11 +62,11 @@ has 0 width, the margin edge is the same as the border edge.
6262
<P>Each edge may be broken down into a top, right, bottom, and left
6363
edge.
6464

65-
<P>The dimensions of the content area of a box -- the <span
65+
<P>The dimensions of the content area of a box &mdash; the <span
6666
class="index-def" title="box::content width"><a
6767
name="content-width"><dfn>content width</dfn></a></span> and <span
6868
class="index-def" title="box::content height"><a
69-
name="content-height"><dfn>content height</dfn></a></span> --
69+
name="content-height"><dfn>content height</dfn></a></span> &mdash;
7070
depend on several factors: whether the element generating
7171
the box has the <span class="propinst-width">'width'</span>
7272
or <span class="propinst-height">'height'</span> property
@@ -106,7 +106,7 @@ interact. The example HTML document:
106106
/* No borders set */
107107
}
108108
LI {
109-
color: white; /* text color is black */
109+
color: white; /* text color is white */
110110
background: blue; /* Content, padding will be blue */
111111
margin: 12px 12px 12px 12px;
112112
padding: 12px 0px 12px 12px; /* Note 0px padding right */
@@ -162,8 +162,8 @@ LI boxes <a href="#collapsing-margins">collapse.</a>
162162
(the <span class="propinst-padding">'padding'</span> property). The
163163
effect is apparent in the second illustration.
164164

165-
<li>The margins of the LI boxes are transparent -- margins are always
166-
transparent -- so the background color (green) of the UL padding and
165+
<li>The margins of the LI boxes are transparent &mdash; margins are always
166+
transparent &mdash; so the background color (green) of the UL padding and
167167
content areas shines through them.
168168

169169
<li>The second LI element specifies a dashed border (the
@@ -550,9 +550,7 @@ value type, which make take one of the following values:</p>
550550

551551
<dl>
552552
<dt><strong><span class="index-def" title="'none'::as border style"><a name="value-def-bo-none" class="value-def">none</a></span></strong>
553-
<dd>No border. This value forces
554-
the computed value of <span class="propinst-border-width">'border-width'</span>
555-
to be '0'.
553+
<dd>No border.
556554
<dt><strong><span class="index-def" title="'hidden'"><a name="value-def-hidden" class="value-def">hidden</a></span></strong>
557555
<dd>Same as 'none', except in terms of <a
558556
href="tables.html#border-conflict-resolution">border conflict

0 commit comments

Comments
 (0)