forked from mirrors/gecko-dev
Automatic update from web-platform-tests [line-clamp] Don't treat clamped content as scrollable overflow In previous patches, any content after a line-clamp clamp point was made hidden for paint. However, if that content overflows a scrollable container, it will still occupy scroll space, because it is counted as scrollable overflow. Instead, it should be treated as ink overflow, which doesn't occupy scroll space. This patch achieves this by having `ScrollableOverflowCalculator` ignore any fragments and fragment items which are marked as hidden for paint. Since the clamp point is usually in the middle of an inline formatting context, and the lines after it must also be treated as ink overflow, this patch also makes it so creating a `FragmentItem` from a `PhysicalLineBoxFragment` which is hidden for paint will result in a hidden for paint fragment item. Bug: 40336192 Change-Id: I90ecd3b17d4e4f559b5fa412a31079e595f28b9f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5412173 Commit-Queue: Andreu Botella <abotella@igalia.com> Reviewed-by: Manuel Rego <rego@igalia.com> Cr-Commit-Position: refs/heads/main@{#1285038} -- wpt-commits: 9f53d39bcef48bdd862491409d1bcd3b8addd10b wpt-pr: 45465
36 lines
607 B
HTML
36 lines
607 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>CSS Reference</title>
|
|
<style>
|
|
#scrollContainer {
|
|
overflow: scroll;
|
|
font: 16px / 32px serif;
|
|
height: 3lh;
|
|
border: 1px solid black;
|
|
}
|
|
.clamp {
|
|
padding: 4px;
|
|
background-color: yellow;
|
|
}
|
|
.pre {
|
|
white-space: pre;
|
|
}
|
|
</style>
|
|
|
|
<div id="scrollContainer">
|
|
|
|
<div class="clamp">
|
|
<div class="pre">Line 1
|
|
Line 2
|
|
Line 3
|
|
Line 4…</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
window.addEventListener("load", () => {
|
|
const scrollContainer = document.getElementById("scrollContainer");
|
|
scrollContainer.scrollTop = scrollContainer.scrollHeight;
|
|
});
|
|
</script>
|