Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-overflow/line-clamp/line-clamp-auto-049.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>CSS Overflow: line-clamp auto updates after a descendant grows</title>
<link rel="match" href="reference/line-clamp-auto-049-ref.html">
<meta name="assert" content="A growing descendant moves an automatic line-clamp target to an earlier line.">
<script src="/common/reftest-wait.js"></script>
<style>
.clamp {
line-clamp: auto;
max-height: 4lh;
font: 20px / 20px monospace;
width: 12ch;
background: yellow;
}
.line-box-sizer {
display: inline-block;
width: 1ch;
height: 1lh;
background: orange;
}
</style>
<div class="clamp">
Line 1 <br>
<span class="line-box-sizer"></span>
Line 2 <br>
Line 3<br>
Line 4<br>
Line 5
</div>
<script>
requestAnimationFrame(() => {
requestAnimationFrame(() => {
document.querySelector(".line-box-sizer").style.height = "2lh";
takeScreenshot();
});
});
</script>