Skip to content

Commit 0ab92b0

Browse files
alanbaradlayannevk
authored andcommitted
[line-clamp] Changing the width of a line-clamp container shows the lines past the clamp point
<div id=container style="line-clamp: 2; width: 300px"><div>Line 1</div><div>Line 2</div><div>Line 3</div></div> <script>document.body.offsetHeight; container.style.width = "200px";</script> Line 3 should stay hidden after the width change. Ensure that the remaining budget goes back to the parent state, the same way the legacy line clamp's does. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=325509 WebKit-Canonical-Link: https://commits.webkit.org/322600@main
1 parent 1bee03c commit 0ab92b0

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>CSS Overflow: line-clamp container with a width change</title>
4+
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#line-clamp">
5+
<link rel="match" href="reference/line-clamp-dynamic-width-change-ref.html">
6+
<meta name="assert" content="Content after the clamp point stays hidden when the width of the line-clamp container changes.">
7+
<style>
8+
.clamp {
9+
line-clamp: 2;
10+
width: 300px;
11+
font: 16px / 32px serif;
12+
background-color: yellow;
13+
}
14+
</style>
15+
<div class="clamp" id="container"><div>Line 1</div><div>Line 2</div><div>Line 3</div></div>
16+
<script>
17+
document.body.offsetHeight;
18+
container.style.width = "200px";
19+
</script>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>CSS Overflow: reference</title>
4+
<style>
5+
.clamp {
6+
width: 200px;
7+
font: 16px / 32px serif;
8+
background-color: yellow;
9+
}
10+
</style>
11+
<div class="clamp"><div>Line 1</div><div>Line 2…</div></div>

0 commit comments

Comments
 (0)