[line-clamp] [text-box-trim] Trim the last line before clamp inside nested blocks
When text-box-trim: trim-end
is used together with line-clamp
, it
should trim the block-end leading of the last line before clamp, the
one with the ellipsis. This worked when that last line before clamp is
directly contained by the line-clamp container, but it doesn't when it
is inside a nested block element.
The reason for this is that, although for InlineNode
s,
ConstraintSpace::ShouldTextBoxTrimNodeEnd
is always set if the
parent BlockNode
is as well; for BlockNode
s, that flag is only set
for nodes that are the last in-flow child node of its parent.
This means that, for line-clamp, there is no flag to tell a child
BlockNode
that it is fine to trim if there's a clamp point inside
it, even if it wouldn't be fine to trim in its last formatted line.
This patch therefore adds a ShouldTextBoxTrimInsideWhenLineClamp
field to ConstraintSpace
to indicate this.
Bug: 40336192, 40254880
Change-Id: I1690ab296dd9686a09f4b9f06a7d86d8998d9446
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5987915
Commit-Queue: Andreu Botella abotella@igalia.com
Reviewed-by: Koji Ishii kojii@chromium.org
Cr-Commit-Position: refs/heads/main@{#1379720}