Don't include BR clearance in the line's height. #30876
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Including clearance in the line height may result in tall monolithic
content, which is problematic for block fragmentation, especially for
column balancing.
Instead, store trailing clearance in the layout result, so that the
block layout algorithm can add it to the layout position for subsequent
content.
We already use a similar trick for ruby annotations, and some care is
required so that we don't move back above the clearance offset when
canceling ruby annotations overflow (which happens in some cases). There
was no test coverage for this, so added three tests for that (they pass
both and without this CL).
Also added a multicol test that demonstrates what this fixes in column
balancing.
Bug: 829028
Change-Id: I84e58326e9ada78e3f29ad01d8043a173626aea3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168645
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923502}