[line-clamp] [text-box-trim] Make text-box-trim
work with line-clamp: auto
When text-box-trim: trim-end
is applied to an element with
line-clamp
, it should trim the last line before clamp. This was
previously implemented when clamping by a determined number of lines,
but not when clamping by a height.
Since the trimming affects the height of the content, this should be
taken into account when clamping. Therefore, in the initial layout
pass that determines the number of lines that fit in that height, if
text-box-trim: trim-end
is set, then every line is trimmed as if it
were the last line before clamp. However, since this might not be the
actual last line before clamp, after laying out the line we make sure
to increase the inflow position's logical block offset so that any
further lines and boxes after it are set at the correct position.
Bug: 40336192, 40254880
Change-Id: I7cb19ca7ebadcf60dec587b3f6cbbf7363f7e64f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5893918
Commit-Queue: Andreu Botella abotella@igalia.com
Reviewed-by: Koji Ishii kojii@chromium.org
Cr-Commit-Position: refs/heads/main@{#1361770}