forked from mirrors/gecko-dev
Automatic update from web-platform-tests [line-clamp] Implement the line-clamp CSS property This patch adds the `line-clamp` property, as well as the `CSSLineClamp` Blink feature. It also makes in-flow inline and block elements after the clamp point hidden for paint in both `line-clamp` and `-webkit-line-clamp` when that feature is enabled, reusing some existing machinery for table cells. This patch does not yet handle hiding out of flow boxes, or height-based clamping. That is left for follow-up CLs. Since `-webkit-line-clamp` and `line-clamp` would usually generate the same `ComputedStyle::LineClamp` method, we instead give those methods the custom names `WebkitLineClamp` and `StandardLineClamp`, and reuse the existing method names `LineClamp` and `HasLineClamp` for custom methods that take both properties into account. Bug: 40336192 Change-Id: Ic7d0cf6f218b45bd2b7aa5bdd26adaeff9d492db Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5317993 Commit-Queue: Andreu Botella <abotella@igalia.com> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/main@{#1281769} -- wpt-commits: d125646c9b17c466c189af0605c5eb72b23f7c51 wpt-pr: 44748
20 lines
627 B
HTML
20 lines
627 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>CSS Overflow: line-clamp with fewer lines than specified</title>
|
|
<link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
|
|
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#line-clamp">
|
|
<link rel="match" href="reference/webkit-line-clamp-001-ref.html">
|
|
<meta name="assert" content="line-clamp should not have an effect on an element with fewer lines than specified.">
|
|
<style>
|
|
.clamp {
|
|
line-clamp: 6;
|
|
font: 16px / 32px serif;
|
|
white-space: pre;
|
|
background-color: yellow;
|
|
}
|
|
</style>
|
|
<div class="clamp">Line 1
|
|
Line 2
|
|
Line 3
|
|
Line 4
|
|
Line 5</div>
|