forked from mirrors/gecko-dev
This is a hack, sorta, similar to Chromium's: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_object.cc;l=356;drc=312b74e385e6aba98ab31fd911238c0dc16b396c except at computed-value rather than used-value time, because it's both simpler to reason about and prevents lying in the computed style. This fixes the relevant test-case, and matches closer what Chromium does, by not creating anonymous flex items for all elements inside the line-clamp context. The behavior change is covered by the test changes. I had to also fix a couple pre-existing bugs that were caught by tests, now that the line-clamped block is the -webkit-box-styled element rather than an anonymous flex item (and thus now had padding). Depends on D155180 Differential Revision: https://phabricator.services.mozilla.com/D155181
18 lines
315 B
HTML
18 lines
315 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>CSS Reference</title>
|
|
<style>
|
|
.clamp {
|
|
display: block;
|
|
font: 16px / 32px serif;
|
|
white-space: pre;
|
|
padding: 0 4px;
|
|
background-color: yellow;
|
|
}
|
|
</style>
|
|
<div class="clamp"><div>Line 1
|
|
Line 2
|
|
Line 3</div><div>Line A
|
|
Line B
|
|
Line C</div>Line 一
|
|
Line 二…</div>
|