Skip to content

Commit 8e3d326

Browse files
authored
Line clamp clips floats in at the block end, not elsewhere (#60577)
See w3c/csswg-drafts#13668 and w3c/csswg-drafts#14047
1 parent 4f9d122 commit 8e3d326

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>CSS Overflow: line-clamp clips floats at the block-end only</title>
4+
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
5+
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#line-clamp-containers">
6+
<link rel="match" href="/css/reference/ref-filled-green-100px-square.xht">
7+
<link rel="stylesheet" href="/fonts/ahem.css">
8+
<meta name="assert" content="Within a line-clamp container, floats which have not been made into invisible boxes must be visually clipped to the block-end content edge of the line-clamp container. Overflow in other directions is not clipped.">
9+
<style>
10+
div {
11+
font: 20px/20px Ahem, monospace;
12+
}
13+
.test {
14+
margin-left: 1ch;
15+
padding-top: 1lh;
16+
width: 3ch;
17+
line-clamp: 4;
18+
color: green;
19+
}
20+
aside {
21+
width: 2ch;
22+
}
23+
.ne, .se {
24+
float: right;
25+
margin-right: -1ch;
26+
}
27+
.ne, .nw {
28+
margin-top: -2lh;
29+
}
30+
.nw, .sw {
31+
float: left;
32+
margin-left: -1ch;
33+
}
34+
a.se { display: none; }
35+
span.red {
36+
color: red;
37+
}
38+
div.backdrop {
39+
color: green;
40+
background: red;
41+
position: absolute;
42+
z-index: -1;
43+
width: 5ch;
44+
height: 5lh;
45+
}
46+
</style>
47+
48+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
49+
50+
<div class=backdrop>..X</div>
51+
<div class=test>
52+
AAA
53+
<aside class=nw>BB CC DD</aside>X<aside class=ne>EE FF GG</aside>
54+
<aside class=sw>HH II <span class=red>JJ</span></aside>K<aside class=se>LL MM <span class=red>NN</span></aside>
55+
OOO
56+
<span class=red>P</span>
57+
</div>
58+

0 commit comments

Comments
 (0)