[line-clamp] Don't hide block-level abspos at the line-clamp: auto
boundary
With line-clamp: auto
, the clamp point should be chosen such that it
is the furthermost possible clamp point where the box doesn't
overflow. Since block-level abspos boxes can have a clamp point after
them (unlike inline-level ones), and they do not increase the
intrinsic size of the container, a block-level abspos box whose static
position is exactly at the boundary should be visible. This was not
what our implementation did, however.
The reason for that is that BlockLineClampData::ShouldHideForPaint
(and BlockLineClampData::IsPastClampPoint
) were always returning
true for line-clamp: auto
when a previous box had been found that
ended exactly at the boundary. This was meant to hide lines and floats
that started exactly at the boundary, since at the time that we're
dealing with them in the block layout algorithm, we don't know the
height of the line; as well as to handle cases where a previous box
might have clamped, but the current BFC offset might still be before
the clamp boundary.
However, this reasoning does not work for block-level abspos, because
they do not take up container space, and because there is a possible
clamp point after them. Therefore, this patch adds an optional
argument for block-level abspos to provide their static BFC offset
instead.
Bug: 40336192
Change-Id: Ia2799a2510c3e2d6d1532198ef72443fac120056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5675924
Reviewed-by: Ian Kilpatrick ikilpatrick@chromium.org
Commit-Queue: Andreu Botella abotella@igalia.com
Cr-Commit-Position: refs/heads/main@{#1326556}