[line-clamp] Fix bug when reusing line fragments with line-clamp: auto
The patch at https://crrev.com/c/5868971 refactored line-clamp: auto
to always do a first pass of layout to determine the number of lines
before clamp, and then a second pass that behaves the same as clamping
with a set number of lines.
However, this patch introduced a bug where, if line fragments were
reused from cache, the number of lines would decrease to match the
number of reused lines in the second layout pass, but it would not
increase by a corresponding amount in the first pass. This meant that
the clamp point would happen at an unexpected place.
This patch fixes this by adding a condition that checks whether we're
in the first layout pass and incrasing the number of lines in that
case.
Bug: 40336192
Change-Id: I7dd339cd37cec3dde79d989b5b49d373387b99eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5907101
Reviewed-by: Koji Ishii kojii@chromium.org
Reviewed-by: Ian Kilpatrick ikilpatrick@chromium.org
Commit-Queue: Andreu Botella abotella@igalia.com
Cr-Commit-Position: refs/heads/main@{#1364824}