Skip to content

Commit 4ea1f27

Browse files
committed
[css-text] Fix tests to match w3c/csswg-drafts#3440
1 parent 6dc095b commit 4ea1f27

15 files changed

+75
-58
lines changed

css/css-text/white-space/pre-wrap-012.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with right alignement</title>
3+
<title>CSS Text level 3 Test: preserved white space at the end of soft-wrapped lines and white-space:pre-wrap with right alignement</title>
44
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/pre-wrap-012-ref.html">
7-
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of the line hang, so they do not have any effect when right-aligning.">
7+
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of soft-wrapped lines hang, so they do not have any effect when right-aligning.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
1010
div {
@@ -22,6 +22,5 @@
2222
</style>
2323
<body>
2424
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
25-
<div>XX&#x20;
26-
XX </div>
25+
<div>XX XX</div>
2726
</body>

css/css-text/white-space/pre-wrap-013.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with center alignement</title>
3+
<title>CSS Text level 3 Test: preserved white space at the end of soft-wrapped lines and white-space:pre-wrap with center alignement</title>
44
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/pre-wrap-013-ref.html">
7-
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of the line hang, so they do not have any effect when centering.">
7+
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of soft-wrapped lines hang, so they do not have any effect when centering.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
1010
div {
@@ -22,6 +22,5 @@
2222
</style>
2323
<body>
2424
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
25-
<div>XX&#x20;
26-
XX </div>
25+
<div>XX XX</div>
2726
</body>

css/css-text/white-space/pre-wrap-014.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with justification</title>
3+
<title>CSS Text level 3 Test: preserved white space at the end of soft-wrapped lines and white-space:pre-wrap with justification</title>
44
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/pre-wrap-014-ref.html">
7-
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of the line hang, so they do not have any effect when justifying.">
7+
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of soft-wrapped lines hang, so they do not have any effect when justifying.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
1010
div {
@@ -27,6 +27,6 @@
2727
</style>
2828
<body>
2929
<p>Test passes if there is a <strong>filled green rectangle</strong> and <strong>no red</strong>.</p>
30-
<div><span>X X</span>&#x20;
31-
X</div><!-- invisible last line, because justification works on non-last lines-->
30+
<div><span>X X</span> X</div>
31+
<!-- invisible last line, because justification works on non-last lines-->
3232
</body>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>Test reference</title>
4+
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
5+
<p>Test passes if there is <strong>no red</strong> below.</p>

css/css-text/white-space/reference/white-space-intrinsic-size-004-ref.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
<meta charset="utf-8">
33
<title>test reference</title>
44
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
5-
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
65
<style>
76
div {
87
color: transparent;
9-
font-family: Ahem;
8+
font-family: monospace;
109
font-size: 50px;
1110
width: 3ch;
12-
height: 2ch;
11+
height: 2em;
1312
background: green;
1413
}
1514
</style>

css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-002-ref.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@
22
<meta charset=utf-8>
33
<title>CSS test Reference</title>
44
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
5+
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
6+
<style>
7+
div {
8+
font-size: 20px;
9+
font-family: Ahem;
10+
line-height: 1em;
11+
white-space: pre-wrap;
12+
}
13+
#test { color: orange; }
14+
#ref { color: blue; }
15+
</style>
516

6-
<p>This test passes if the letters below are spaced equally.
17+
<p>This test passes if the orange blocks below are vertically aligned with the blue ones.
718

8-
<div>X X X X</div>
19+
<div id=test>X X X X</div>
20+
<div id=ref>X X X X</div>

css/css-text/white-space/textarea-pre-wrap-012.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with right alignement in a textarea</title>
3+
<title>CSS Text level 3 Test: preserved white space at the end of soft-wrapped lines and white-space:pre-wrap with right alignement in a textarea</title>
44
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
6-
<link rel="match" href="reference/textarea-pre-wrap-001-ref.html">
7-
<meta name="assert" content="When white-space is pre-wrap, only spaces that overflow the line get collapsed or hanged, the ones that fit have an effect when right-aligning in a textarea.">
6+
<link rel="match" href="reference/pre-wrap-012-ref.html">
7+
<meta name="assert" content="When white-space is pre-wrap, only spaces at the end of soft-wrapped lines get collapsed or hanged, so they do not have any effect when right aligning.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
1010
textarea {
@@ -25,7 +25,7 @@
2525
white-space: pre-wrap;
2626
color: green;
2727

28-
background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;
28+
background: linear-gradient(red, red) 1ch 0/2ch 2ch no-repeat;
2929

3030
width: 3ch;
3131
text-align: right;

css/css-text/white-space/textarea-pre-wrap-013.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with center alignement in a textarea</title>
3+
<title>CSS Text level 3 Test: preserved white space at the end of soft-wrapped line and white-space:pre-wrap with center alignement in a textarea</title>
44
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
6-
<link rel="match" href="reference/textarea-pre-wrap-001-ref.html">
7-
<meta name="assert" content="When white-space is pre-wrap, only spaces that overflow the line get collapsed or hanged, the ones that fit have an effect when centering in a textarea.">
6+
<link rel="match" href="reference/pre-wrap-013-ref.html">
7+
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of soft-wrapped lines get collapsed or hanged, so they do not have any effect when centering.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
1010
textarea {
@@ -25,14 +25,13 @@
2525
white-space: pre-wrap;
2626
color: green;
2727

28-
background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;
28+
background: linear-gradient(red, red) 0.5ch 0/2ch 2ch no-repeat;
2929

3030
width: 3ch;
3131
text-align: center;
3232
}
3333
</style>
3434
<body>
3535
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
36-
<textarea>XX&#x20;
37-
XX </textarea>
36+
<textarea>XX XX</textarea>
3837
</body>

css/css-text/white-space/textarea-pre-wrap-014.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with justification in a textarea</title>
3+
<title>CSS Text level 3 Test: preserved white space at the end of soft-wrapped lines and white-space:pre-wrap with justification in a textarea</title>
44
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
6-
<link rel="match" href="reference/textarea-pre-wrap-001-ref.html">
7-
<meta name="assert" content="When white-space is pre-wrap, only spaces that overflow the line get collapsed or hanged, the ones that fit have an effect when justifying in a textarea.">
6+
<link rel="match" href="reference/textarea-pre-wrap-014-ref.html">
7+
<meta name="assert" content="When white-space is pre-wrap, spaces at the end of a soft-wrapped line get collapsed or hanged, and don't influence justification.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
1010
textarea {
@@ -23,17 +23,15 @@
2323
font-family: Ahem;
2424
line-height: 1em;
2525
white-space: pre-wrap;
26-
color: green;
26+
color: white;
2727

28-
background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;
28+
background: linear-gradient(red, red) 3ch 0/2ch 1ch no-repeat;
2929

30-
width: 3ch;
30+
width: 4ch;
3131
text-align: justify;
32-
text-justify: inter-character;
3332
}
3433
</style>
3534
<body>
36-
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
37-
<textarea>X&#8203;X&#x20;
38-
X&#8203;X </textarea>
35+
<p>Test passes if there is <strong>no red</strong> below.</p>
36+
<textarea>X X X</textarea>
3937
</body>

css/css-text/white-space/white-space-intrinsic-size-004.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
77
<meta name="flags" content="">
88
<link rel="match" href="reference/white-space-intrinsic-size-004-ref.html">
9-
<meta name="assert" content="Preserved spaces at the end of the line do affect the intrinsic max-content size when white-space is pre-wrap, as hanging does not prevent contributing to the max-content size. The value of overflow-wrap makes no difference.">
10-
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
9+
<meta name="assert" content="Preserved spaces at the end of the line do affect the intrinsic max-content size when white-space is pre-wrap, as spaces before a forced break, at the end of un unwrapped line, only hanging conditionally, which does not prevent contributing to the max-content size. The value of overflow-wrap makes no difference.">
1110
<style>
1211
aside {
1312
float: left;
@@ -18,10 +17,10 @@
1817
div {
1918
background: red;
2019
color: transparent;
21-
font-family: Ahem;
20+
font-family: monospace;
2221
font-size: 50px;
2322
width: 3ch;
24-
height: 2em;
23+
line-height: 1;
2524
}
2625
</style>
2726

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<!doctype html>
22
<meta charset=utf-8>
3-
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
3+
<title>CSS Text test: alignement and trailing spaces with white-space:pre-wrap</title>
44
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-001-ref.html">
7-
<meta name="assert" content="Preserved white space at the end of the line is hanged when white-space is pre-wrap.">
7+
<meta name="assert" content="Preserved white space with pre-wrap at the end of a line ending with a forced line break conditionally hangs, so it does affect alignment.">
88

99
<style>
1010
div {
1111
white-space: pre-wrap;
1212
font-family: monospace;
1313
}
14-
div:nth-of-type(1),
1514
div:nth-of-type(2) {
16-
width: 5ch;
15+
width: 7ch;
1716
text-align: right;
1817
}
1918
div:nth-of-type(3),
@@ -25,7 +24,7 @@
2524

2625
<p>This test passes if the 4 letters below are verticaly aligned.
2726

28-
<div>P</div>
29-
<div>A </div>
30-
<div>S</div>
31-
<div>S </div>
27+
<div> P</div>
28+
<div>A </div>
29+
<div> S </div>
30+
<div> S </div>
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
<!doctype html>
22
<meta charset=utf-8>
3-
<title>CSS Text test: intrinsic maximum sizing of trailing spaces with white-space:pre-wrap</title>
3+
<title>CSS Text test: intrinsic maximum sizing and alignment of trailing spaces with white-space:pre-wrap</title>
44
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-002-ref.html">
7-
<meta name="assert" content="Hanging preserved white space at the end of the line when white-space is pre-wrap has no effect on the max-content size.">
8-
7+
<meta name="assert" content="Preserved white space with white-space is pre-wrap at the end of the line before a forced-break only hangs conditionally, and therefore is included in the max-content size, and taken into account for alignemnt (since it doesn't actually hang in this situation).">
8+
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
10+
div {
11+
font-size: 20px;
12+
font-family: Ahem;
13+
line-height: 1em;
14+
white-space: pre-wrap;
15+
}
1016
span {
1117
display: inline-block;
12-
white-space: pre-wrap;
1318
}
1419
#s1 { text-align: right; }
1520
#s2 { text-align: center; }
21+
#test { color: orange; }
22+
#ref { color: blue; }
1623
</style>
1724

18-
<p>This test passes if the letters below are spaced equally.
25+
<p>This test passes if the orange blocks below are vertically aligned with the blue ones.
1926

20-
<div><span id=s1>X </span><span id=s2>X </span>X X</div>
27+
<div id=test><span id=s1>X </span><span id=s2> X </span> X X</div>
28+
<div id=ref>X X X X</div>

css/css-text/white-space/white-space-pre-wrap-trailing-spaces-003.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-003-ref.html">
7-
<meta name="assert" content="Preserved white space at the end of the line is hanged when white-space is pre-wrap, and therefore does not count when computing the (minimum) intrinsic size.">
7+
<meta name="assert" content="Preserved white space at the end of soft-wrapped lines is hanged when white-space is pre-wrap, and therefore does not count when computing the (minimum) intrinsic size.">
88

99
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
1010
<style>

css/css-text/white-space/white-space-pre-wrap-trailing-spaces-004.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<link rel="author" title="Javier Fernandez" href="mailto:[email protected]">
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
7-
<meta name="assert" content="Preserved white space at the end of the line is hanged when white-space is pre-wrap.">
7+
<meta name="assert" content="Preserved white space at the end of a soft-wrapped line is hanged when white-space is pre-wrap.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
99
<style>
1010
div {

css/css-text/white-space/white-space-pre-wrap-trailing-spaces-005.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<link rel="author" title="Javier Fernandez" href="mailto:[email protected]" />
55
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
66
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
7-
<meta name="assert" content="Preserved white space at the end of the line is hanged when white-space is pre-wrap.">
7+
<meta name="assert" content="Preserved white space at the end of a soft-wrapped line is hanged when white-space is pre-wrap.">
88
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
99
<style>
1010
div {

0 commit comments

Comments
 (0)