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-038.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>CSS Overflow: `line-clamp: auto` cached layout test</title>
<link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
<link rel="match" href="reference/line-clamp-auto-038-ref.html">
<meta name="assert" content="This is a test to make sure that, if lines are cached on a layout of a `line-clamp: auto` container (for example, because an inline block changed size), they should have the right behavior.">
<style>
.clamp {
line-clamp: auto;
max-height: 4lh;
font: 16px / 32px serif;
white-space: pre;
background-color: yellow;
border: 1px solid black;
padding: 4px;
}
#inline-block {
display: inline-block;
background-color: orange;
height: 0.5lh;
width: 1em;
}
</style>
<div class="clamp">Line 1
Line 2
Line 3
Line <span id="inline-block"></span> 4
Line 5
Line 6</div>
<p>Following content.</p>
<script>
window.onload = () => {
document.getElementById("inline-block").style.width = "2em";
document.documentElement.className = "";
};
</script>