[line-clamp] Make the sizes of line-clamped boxes account for margins
Chromium's implementation of (-webkit-)line-clamp in LayoutNG, until
now, set the size of a clamped box to the logical block offset at
which the last inflow child before the clamp point ends, and it
cleared the end margin strut. This meant that if a clamp point was
nested in multiple block boxes, the bottom margins of those boxes
would be ignored.
With the collapse version of line-clamp
, instead, the sizes of
clamped boxes should be the same as if they had no content after the
clamp point. To achieve this, rather than storing the intrinsic block
size offset at the clamp point, we store the PreviousInflowPosition
.
Then, in BlockLayoutAlgorithm::FinishLayout
, the size is determined
based on the previous inflow position at clamp point, rather than
based on the one at the end of the box's hidden children.
Bug: 40336192
Change-Id: I9810d2d1b00d4a9e28c0f5f92653f7d3cbed454c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5683304
Reviewed-by: Ian Kilpatrick ikilpatrick@chromium.org
Commit-Queue: Andreu Botella abotella@igalia.com
Cr-Commit-Position: refs/heads/main@{#1324525}