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-056.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>CSS Overflow: line-clamp auto across balanced trial reflows</title>
<link rel="match" href="reference/line-clamp-auto-056-ref.html">
<meta name="assert" content="Automatic line-clamp is recomputed after incremental text-wrap balance trial reflows.">
<script src="/common/reftest-wait.js"></script>
<style>
.clamp {
line-clamp: auto;
max-height: 3lh;
font: 20px / 20px monospace;
width: 10ch;
text-wrap: balance;
background: yellow;
}
.final {
width: 14ch;
}
</style>
<div class="clamp">
Balanced text changes its lines after the container width changes significantly.
</div>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.querySelector(".clamp").classList.add("final");
takeScreenshot();
}));
</script>