Skip to content

Commit 6571044

Browse files
committed
[css2] Added extra field for media information to properties/descriptors
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%40414
1 parent 01e1191 commit 6571044

6 files changed

Lines changed: 176 additions & 162 deletions

File tree

css2/bin/Attic/dextr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/local/bin/perl
22
# Extract entries from the CSS properties database
33
# The database has the following format:
4-
# name;; values;; initial-value
4+
# name;; values;; initial-value;; media
55
# Special characters:
66
# 1) Translate "*" into the words "all elements"
77
# 1.a) Translate "XX" into "not defined for shorthand properties"
@@ -12,7 +12,7 @@
1212
# <span class="propinst-name">&lt;'name'&gt;</span>
1313
#
1414
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
15-
# $Id: dextr,v 1.3 1997-10-03 20:53:48 ian Exp $
15+
# $Id: dextr,v 1.4 1997-11-20 23:50:43 ian Exp $
1616

1717
$PROGNAME = substr($0, rindex($0, "/") + 1);
1818

@@ -47,12 +47,14 @@ sub format_descriptor {
4747
$name = $_[0];
4848
$values = $_[1];
4949
$init = $_[2];
50+
$media = $_[3];
5051
print output "<DIV class=\"descdef\">\n";
5152
print output "<P><a name=\"descdef-$name\" class=\"descdef-title\"><strong>'$name'</strong> (Descriptor)</a></P>\n";
5253
print output "<TABLE class=\"descinfo\">\n";
5354
&format_name($name);
5455
&format_values($values);
5556
&format_init($init);
57+
&format_init($media);
5658
print output "</TABLE>\n";
5759
print output "</DIV>\n\n";
5860
}
@@ -77,15 +79,19 @@ $init =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">&lt;'$1'&gt;<\/span>/g;
7779
print output "<TR valign=\"top\"><TH align=\"right\">Initial:<TD>$init</TR>\n";
7880
}
7981

82+
sub format_init {
83+
print output "<TR valign=\"top\"><TH align=\"right\">Applies to media:<TD>$media</TR>\n";
84+
}
85+
8086
# extract every possible block
8187
$_ = $buf;
82-
while (/$blockst$patt;;$patt;;$patt$blocket/s) {
88+
while (/$blockst$patt;;$patt;;$patt;;$patt$blocket/s) {
8389
# Set parameters first (before any modifications)
8490
$placeholder = $';
8591
$output = "$path$1.srb";
8692
print "\textracting $output\n";
8793
open(output, "> $output");
88-
&format_descriptor($1, $2, $3);
94+
&format_descriptor($1, $2, $3, $4);
8995
close(output);
9096
$_ = $placeholder;
9197
}

css2/bin/Attic/pextr

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/local/bin/perl
22
# Extract entries from the CSS properties database
33
# The database has the following format:
4-
# name;; values;; initial-value;; applies-to;; inherited;; percentages
4+
# name;; values;; initial-value;; applies-to;;
5+
# inherited;; percentages;; media;;
56
# Special characters:
67
# 1) Translate "*" into the words "all elements"
78
# 1.a) Translate "XX" into "not defined for shorthand properties"
@@ -12,7 +13,7 @@
1213
# <span class="propinst-name">&lt;'name'&gt;</span>
1314
#
1415
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
15-
# $Id: pextr,v 1.4 1997-10-03 20:55:29 ian Exp $
16+
# $Id: pextr,v 1.5 1997-11-20 23:50:13 ian Exp $
1617

1718
$PROGNAME = substr($0, rindex($0, "/") + 1);
1819

@@ -50,6 +51,7 @@ $init = $_[2];
5051
$applies = $_[3];
5152
$inherited = $_[4];
5253
$percentages = $_[5];
54+
$media = $_[6];
5355
#Do next three lines in src files to get headings right.
5456
print output "<DIV class=\"propdef\">\n";
5557
print output "<P><a name=\"propdef-$name\" class=\"propdef-title\"><strong>'$name'</strong></a></P>\n";
@@ -60,6 +62,7 @@ print output "<TABLE class=\"propinfo\">\n";
6062
&format_applies($applies);
6163
&format_inherited($inherited);
6264
&format_percentages($percentages);
65+
&format_media($media);
6366
print output "</TABLE>\n";
6467
print output "</DIV>\n\n";
6568
}
@@ -106,15 +109,20 @@ $perc =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
106109
print output "<TR valign=\"top\"><TH align=\"right\">Percentage values:<TD>$perc</TR>\n";
107110
}
108111

112+
sub format_media {
113+
print output "<TR valign=\"top\"><TH align=\"right\">Applies to media:<TD>$_[0]</TR>\n";
114+
}
115+
116+
109117
# extract every possible block
110118
$_ = $buf;
111-
while (/$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
119+
while (/$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
112120
# Set parameters first (before any modifications)
113121
$placeholder = $';
114122
$output = "$path$1.srb";
115123
print "\textracting $output\n";
116124
open(output, "> $output");
117-
&format_property($1, $2, $3, $4, $5, $6);
125+
&format_property($1, $2, $3, $4, $5, $6, $7);
118126
close(output);
119127
$_ = $placeholder;
120128
}

css2/bin/dextr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/local/bin/perl
22
# Extract entries from the CSS properties database
33
# The database has the following format:
4-
# name;; values;; initial-value
4+
# name;; values;; initial-value;; media
55
# Special characters:
66
# 1) Translate "*" into the words "all elements"
77
# 1.a) Translate "XX" into "not defined for shorthand properties"
@@ -12,7 +12,7 @@
1212
# <span class="propinst-name">&lt;'name'&gt;</span>
1313
#
1414
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
15-
# $Id: dextr,v 1.3 1997-10-03 20:53:48 ian Exp $
15+
# $Id: dextr,v 1.4 1997-11-20 23:50:43 ian Exp $
1616

1717
$PROGNAME = substr($0, rindex($0, "/") + 1);
1818

@@ -47,12 +47,14 @@ sub format_descriptor {
4747
$name = $_[0];
4848
$values = $_[1];
4949
$init = $_[2];
50+
$media = $_[3];
5051
print output "<DIV class=\"descdef\">\n";
5152
print output "<P><a name=\"descdef-$name\" class=\"descdef-title\"><strong>'$name'</strong> (Descriptor)</a></P>\n";
5253
print output "<TABLE class=\"descinfo\">\n";
5354
&format_name($name);
5455
&format_values($values);
5556
&format_init($init);
57+
&format_init($media);
5658
print output "</TABLE>\n";
5759
print output "</DIV>\n\n";
5860
}
@@ -77,15 +79,19 @@ $init =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">&lt;'$1'&gt;<\/span>/g;
7779
print output "<TR valign=\"top\"><TH align=\"right\">Initial:<TD>$init</TR>\n";
7880
}
7981

82+
sub format_init {
83+
print output "<TR valign=\"top\"><TH align=\"right\">Applies to media:<TD>$media</TR>\n";
84+
}
85+
8086
# extract every possible block
8187
$_ = $buf;
82-
while (/$blockst$patt;;$patt;;$patt$blocket/s) {
88+
while (/$blockst$patt;;$patt;;$patt;;$patt$blocket/s) {
8389
# Set parameters first (before any modifications)
8490
$placeholder = $';
8591
$output = "$path$1.srb";
8692
print "\textracting $output\n";
8793
open(output, "> $output");
88-
&format_descriptor($1, $2, $3);
94+
&format_descriptor($1, $2, $3, $4);
8995
close(output);
9096
$_ = $placeholder;
9197
}

css2/bin/pextr

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/local/bin/perl
22
# Extract entries from the CSS properties database
33
# The database has the following format:
4-
# name;; values;; initial-value;; applies-to;; inherited;; percentages
4+
# name;; values;; initial-value;; applies-to;;
5+
# inherited;; percentages;; media;;
56
# Special characters:
67
# 1) Translate "*" into the words "all elements"
78
# 1.a) Translate "XX" into "not defined for shorthand properties"
@@ -12,7 +13,7 @@
1213
# <span class="propinst-name">&lt;'name'&gt;</span>
1314
#
1415
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
15-
# $Id: pextr,v 1.4 1997-10-03 20:55:29 ian Exp $
16+
# $Id: pextr,v 1.5 1997-11-20 23:50:13 ian Exp $
1617

1718
$PROGNAME = substr($0, rindex($0, "/") + 1);
1819

@@ -50,6 +51,7 @@ $init = $_[2];
5051
$applies = $_[3];
5152
$inherited = $_[4];
5253
$percentages = $_[5];
54+
$media = $_[6];
5355
#Do next three lines in src files to get headings right.
5456
print output "<DIV class=\"propdef\">\n";
5557
print output "<P><a name=\"propdef-$name\" class=\"propdef-title\"><strong>'$name'</strong></a></P>\n";
@@ -60,6 +62,7 @@ print output "<TABLE class=\"propinfo\">\n";
6062
&format_applies($applies);
6163
&format_inherited($inherited);
6264
&format_percentages($percentages);
65+
&format_media($media);
6366
print output "</TABLE>\n";
6467
print output "</DIV>\n\n";
6568
}
@@ -106,15 +109,20 @@ $perc =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
106109
print output "<TR valign=\"top\"><TH align=\"right\">Percentage values:<TD>$perc</TR>\n";
107110
}
108111

112+
sub format_media {
113+
print output "<TR valign=\"top\"><TH align=\"right\">Applies to media:<TD>$_[0]</TR>\n";
114+
}
115+
116+
109117
# extract every possible block
110118
$_ = $buf;
111-
while (/$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
119+
while (/$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
112120
# Set parameters first (before any modifications)
113121
$placeholder = $';
114122
$output = "$path$1.srb";
115123
print "\textracting $output\n";
116124
open(output, "> $output");
117-
&format_property($1, $2, $3, $4, $5, $6);
125+
&format_property($1, $2, $3, $4, $5, $6, $7);
118126
close(output);
119127
$_ = $placeholder;
120128
}

css2/properties/descriptors.db

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
# Database for descriptors
22
/* font-family;;
33
[ <family-name> | <generic-family> ] [, [<family-name> | <generic-family> ]]*;;
4-
depends on user agent
4+
depends on user agent ;; visual
55
*/
66

77
/* font-style;;
88
[ normal | italic | oblique ] [, [normal | italic | oblique] ]*;;
9-
normal
9+
normal ;; visual
1010
*/
1111

1212
/* font-variant;;
1313
[normal | small-caps] [,[normal | small-caps]]*;;
14-
normal
14+
normal ;; visual
1515
*/
1616

1717
/* font-weight;;
1818
all | [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800] [, [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800]]*;;
19-
normal
19+
normal ;; visual
2020
*/
2121

22-
/* font-size;; all | [<length> [,[<length>]]* ];; all */
22+
/* font-size;; all | [<length> [,[<length>]]* ];; all ;; visual*/
2323

24-
/* unicode-range;; <urange>+;; U+0-7FFFFFFF */
25-
/* units-per-em;; <number>;; undefined */
24+
/* unicode-range;; <urange>+;; U+0-7FFFFFFF ;; visual*/
25+
/* units-per-em;; <number>;; undefined ;; visual*/
2626
/* src;; [ <url> [format [,format]*]? | <font-face-name> ] [, <url>
2727
[format [,format]*]?] | <font-face-name> ]*;;
28-
undefined
28+
undefined ;; visual
2929
*/
30-
/* panose-1;; [<number>]{10};; 0 0 0 0 0 0 0 0 0 0 */
31-
/* stemv;; <number>;; undefined */
32-
/* stemh;; <number>;; undefined */
33-
/* slope;; <number>;; 0 */
34-
/* cap-height;; <number>;; undefined */
35-
/* x-height;; <number>;; undefined */
36-
/* ascent;; <number>;; undefined */
37-
/* descent;; <number>;; undefined */
30+
/* panose-1;; [<number>]{10};; 0 0 0 0 0 0 0 0 0 0 ;; visual*/
31+
/* stemv;; <number>;; undefined ;; visual*/
32+
/* stemh;; <number>;; undefined ;; visual*/
33+
/* slope;; <number>;; 0 ;; visual*/
34+
/* cap-height;; <number>;; undefined ;; visual*/
35+
/* x-height;; <number>;; undefined ;; visual*/
36+
/* ascent;; <number>;; undefined ;; visual*/
37+
/* descent;; <number>;; undefined ;; visual*/
3838
/* widths;; [<urange> ]? [<number> ]+ [,[<urange> ]? <number> ]+];; undefined
39-
*/
40-
/* definition-src;; <url>;; undefined */
41-
/* baseline;; <number>;; 0 */
42-
/* centerline;; <number>;; undefined */
43-
/* mathline;; <number>;; undefined */
44-
/* topline;; <number>;; undefined */
39+
;; visual*/
40+
/* definition-src;; <url>;; undefined ;; visual*/
41+
/* baseline;; <number>;; 0 ;; visual*/
42+
/* centerline;; <number>;; undefined ;; visual*/
43+
/* mathline;; <number>;; undefined ;; visual*/
44+
/* topline;; <number>;; undefined ;; visual*/
4545

0 commit comments

Comments
 (0)